Skip to content

Graceful handling of invalid HTTP Methods #5881

@jeremyjpj0916

Description

@jeremyjpj0916

Passing an invalid HTTP Method produces 500 level server errors.

Summary

/ $ curl -Xfoo localhost:8000/ -vv
*   Trying 127.0.0.1:8000...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8000 (#0)
> foo / HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.66.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Date: Mon, 11 May 2020 20:36:14 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 142
< Connection: close
< X-Response-Latency: 0
<
<html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
</body>
</html>
* Closing connection 0
/ $

Seems an odd behavior out of NGINX that affects Kong, I would expect a 400 Bad Request if anything on invalid HTTP Methods, otherwise to just allow it and pass through with no harm.

Steps To Reproduce

  1. Do what I did above on your Kong instance

Additional Details & Logs

  • Kong version 1.4.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions