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

HTTP HEAD not implemented for HTTP GET similar to ExpressJS v4. #874

Open
jmrnilsson opened this issue Nov 10, 2023 · 0 comments
Open

HTTP HEAD not implemented for HTTP GET similar to ExpressJS v4. #874

jmrnilsson opened this issue Nov 10, 2023 · 0 comments

Comments

@jmrnilsson
Copy link

jmrnilsson commented Nov 10, 2023

Is your feature request related to a problem? Please describe.
Express-OpenAPI-Validator doesn't implement HTTP HEAD for GET by default. This is unlike ExpressJS. I wasn't able find any mention of the HEAD command in documentation. HEAD is typically accepted for any GET command but a body is not returned.

Describe the solution you'd like
Default behavior that doesn't allow HTTP HEAD when only GET specified in OAS. There are no options to enable this behavior. In fact, disabling all OAS-validations still changes the ExpressJS behavior. If OAS middleware is used it effectively changes the behavior and returns 405 Method not allowed.

Describe alternatives you've considered
Complete replicated configuration of HTTP HEAD along side HTTP HEAD in the OAS. This is a lot of extra work and may create a OAS almost twice as big in some cases. It would be useful to either change the default behavior or add configuration option.

Additional context
Many frameworks, ExpressJS v.4 included, assumes HEAD can be sent for any GET commands for pre-flights or just probing w/o necessarily inspecting any results. It's very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant