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

Not found returns 405 if methods are POST/DELETE etc.. #176

Closed
2 tasks done
kfirfer opened this issue Feb 19, 2023 · 8 comments
Closed
2 tasks done

Not found returns 405 if methods are POST/DELETE etc.. #176

kfirfer opened this issue Feb 19, 2023 · 8 comments
Assignees
Milestone

Comments

@kfirfer
Copy link

kfirfer commented Feb 19, 2023

Is there an existing issue for this?

  • I have searched the existing issues
  • And it has nothing to do with Traefik

Describe the bug

When sending regular not found URL with GET method, im getting 404 as usual
when sending the same thing with methods other than GET, its returns getting 405

Using ingress-nginx controller
And the helm chart configuration & log below:

Steps to reproduce

No response

Configuration files

controller:
  config:
    custom-http-errors: "400,401,403,404,405,407,408,409,410,411,412,413,416,418,429,500,502,503,504,505"
    
defaultBackend:
  enabled: true
  image:
    repository: tarampampam/error-pages
    tag: "2.20.0"
  extraEnvs:
    - name: TEMPLATE_NAME # Optional: change the default theme
      value: "app-down"
    - name: SHOW_DETAILS # Optional: enables the output of additional information on error pages
      value: "true"
    - name: LOG_FORMAT
      value: "json"   


### Relevant log output

```shell
This is the log from default backend pod:

[ingress-nginx-defaultbackend-869c98f496-d644d ingress-nginx-default-backend] 2023-02-19T10:26:44.092636417Z {"level":"info","ts":1676802404.092549,"msg":"HTTP request processed","useragent":"PostmanRuntime/7.28.4","method":"POST","url":"/","referer":"","status_code":405,"content_type":"text/plain; charset=utf-8","connection_close":false,"duration":0.000008231,"request_headers":["Host: paa-theruntime.local.platform.test","Content-Length: 243","Content-Type: application/json","User-Agent: PostmanRuntime/7.28.4","Cookie: INGRESSCOOKIE=2ec12f7f26a5b8a4fd603d8b8e5fbd0c|d8628a0b5df4f2b5b6b4858b98a105ce","X-Code: 404","X-Format: */*","X-Original-Uri: /api/runtime/token/v3","X-Request-Id: f4d77e12250191364f9b947e3182d74f","X-Forwarded-For: 192.168.65.4","Accept: */*","Postman-Token: 9d83ccbe-2284-4699-b9ae-42f9eabda61d","Accept-Encoding: gzip, deflate, br","X-Forwarded-Proto: http","X-Envoy-Internal: true","X-B3-Traceid: f5ded2c870cdfe6564cb192bbd092bb9","X-B3-Spanid: 64cb192bbd092bb9","X-B3-Sampled: 1"],"response_headers":["Content-Type: text/plain; charset=utf-8","Allow: GET, OPTIONS"]}


### Anything else?

_No response_
@kfirfer kfirfer added the type:bug Something isn't working label Feb 19, 2023
@tarampampam tarampampam removed the type:bug Something isn't working label Feb 23, 2023
@tarampampam
Copy link
Owner

This is not a bug, this is expected behavior. Does this break something on your side?

@kfirfer
Copy link
Author

kfirfer commented Feb 23, 2023

hi
when we make post http request to place that does not exists the response little cobfusing while i guess its returns not found

@tarampampam
Copy link
Owner

I understood, thanks for your issue! But the implemented GET method is enough, isn't it?

@kfirfer
Copy link
Author

kfirfer commented Feb 24, 2023

@tarampampam i guess not, cause its missleading the api consumer
if the app returns 405 , its hard to know if its from the app or from default backend

@maksimkurb
Copy link

Got the same error when tried to setup WebDAV server. WebDAV clients make PROPFIND HTTP request and instead of 401 error (to understand that they must provide credentials) they receive 405 Method Not Allowed, so they not even trying to provide password and failing.

Temporary solved by removing 401 error from nginx ingress custom-http-errors option.

@vllange
Copy link

vllange commented Apr 28, 2024

@tarampampam I would like to see support for all methods here. And depending on the content type, the response is then returned in JSON (as is currently the practice). But answering API requests with 405 instead of the correct - in my case 403 - breaks many applications.

If I request POST /test and /test does not exist, then the response status should be 404 and not 405.

@tarampampam
Copy link
Owner

tarampampam commented Apr 28, 2024

I'm sorry, but I'm currently working on another project, and I have a lot of work at my regular workplace as well. However, when I have some free time, I plan to deeply refactor this project and address most of the issues and requested features. I hope you understand 🙏🏿

@tarampampam
Copy link
Owner

Hello everyone! While working on version 3, I added support for any method to request error pages. The third version will be released very soon. I apologize for the long wait and thank you for your patience

@tarampampam tarampampam added this to the v3 milestone Jul 3, 2024
@tarampampam tarampampam mentioned this issue Jul 3, 2024
Merged
4 tasks
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

4 participants