Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return a 400 when requesting an invalid feature #1886

Closed
i-like-robots opened this issue Feb 11, 2019 · 2 comments · Fixed by #2088
Closed

Return a 400 when requesting an invalid feature #1886

i-like-robots opened this issue Feb 11, 2019 · 2 comments · Fixed by #2088

Comments

@i-like-robots
Copy link
Contributor

i-like-robots commented Feb 11, 2019

type: Feature request

What

When requesting polyfills it is currently possible to request a non-existent feature and receive a JS bundle in response, e.g.:

https://www.ft.com/__origami/service/polyfill/v3/polyfill.min.js?features=abcde

Details

I do not think this is desirable behaviour as it makes it possible for folks to incorrectly assume a feature exists or type in a feature name incorrectly without noticing. For example in this PR I referenced a different version of the docs (cc #1867) and because my page continued to work (and because my testing was rubbish) I assumed it was OK.

I think it may be beneficial to be stricter and respond with a 400: Bad Request when an invalid feature is requested to protect fools like me from tripping themselves up.

@JakeChampion
Copy link
Collaborator

I like this. It would be good for a v4 release

@JakeChampion
Copy link
Collaborator

We could add a new query parameter to enable a "strict" mode which could do this, that way we would not need to increment the API version number.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants