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

Documentation URLs treat HEAD as not allowed #197

Closed
roman-khimov opened this issue Apr 11, 2024 · 0 comments · Fixed by #199
Closed

Documentation URLs treat HEAD as not allowed #197

roman-khimov opened this issue Apr 11, 2024 · 0 comments · Fixed by #199
Assignees
Labels
enhancement Improving existing functionality I3 Minimal impact S4 Routine U3 Regular
Milestone

Comments

@roman-khimov
Copy link
Member

Is your feature request related to a problem? Please describe.

Documentation redirects and pages respond with 405 to HEAD requests:

$ curl -s -D - 127.0.0.1:8090
HTTP/1.1 307 Temporary Redirect
Location: /v1/docs
Date: Thu, 11 Apr 2024 19:09:14 GMT
Content-Length: 0
$ curl -s -I 127.0.0.1:8090
HTTP/1.1 405 Method Not Allowed
Allow: OPTIONS, GET
Date: Thu, 11 Apr 2024 19:07:04 GMT
$ curl -s -D - 127.0.0.1:8090/v1/docs/
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 651
Content-Type: text/html; charset=utf-8
Date: Thu, 11 Apr 2024 19:09:38 GMT

<!DOCTYPE html>
<html lang="en">
...
$ curl -s -I 127.0.0.1:8090/v1/docs/
HTTP/1.1 405 Method Not Allowed
Allow: OPTIONS, GET
Date: Thu, 11 Apr 2024 19:09:55 GMT
$ curl -s -D - 127.0.0.1:8090/v1/docs/kkk
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=UTF-8
Date: Thu, 11 Apr 2024 19:11:25 GMT
Content-Length: 24

{"message":"Not Found"}
$ curl -s -I 127.0.0.1:8090/v1/docs/kkk
HTTP/1.1 405 Method Not Allowed
Allow: OPTIONS, GET
Date: Thu, 11 Apr 2024 19:11:21 GMT

Describe the solution you'd like

Process HEAD normally, return whatever headers are appropriate (307/200/400). It's a documentation page, it should process HEAD in a regular way.

@roman-khimov roman-khimov added U3 Regular enhancement Improving existing functionality S4 Routine I3 Minimal impact labels Apr 11, 2024
@roman-khimov roman-khimov added this to the v0.8.4 milestone Apr 11, 2024
@tatiana-nspcc tatiana-nspcc self-assigned this Apr 15, 2024
tatiana-nspcc added a commit that referenced this issue Apr 17, 2024
Previously, URLS: "/", "/v1/docs/", "/v1/docs/swagger.json" returned the error
"405 Method Not Allowed". But now they return the same headers as GET requests.

Close #197.

Signed-off-by: Tatiana Nesterenko <tatiana@nspcc.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality I3 Minimal impact S4 Routine U3 Regular
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants