Skip to content

Commit

Permalink
feat(core) handle native 400 response codes
Browse files Browse the repository at this point in the history
In addition to BAD_REQUEST messages sent by Kong, we should also
handle natively-generated 400 response codes.
  • Loading branch information
p0pr0ck5 committed May 2, 2017
1 parent 0895413 commit a0abe84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions kong/core/error_handlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ local xml_template = '<?xml version="1.0" encoding="UTF-8"?>\n<error><message>%s
local html_template = '<html><head><title>Kong Error</title></head><body><h1>Kong Error</h1><p>%s.</p></body></html>'

local BODIES = {
s400 = "Bad request",
s404 = "Not found",
s408 = "Request timeout",
s411 = "Length required",
Expand Down
2 changes: 1 addition & 1 deletion kong/templates/nginx_kong.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ server {
> else
listen ${{PROXY_LISTEN}};
> end
error_page 404 408 411 412 413 414 417 /kong_error_handler;
error_page 400 404 408 411 412 413 414 417 /kong_error_handler;
error_page 500 502 503 504 /kong_error_handler;
access_log logs/access.log;
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/custom_nginx.template
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ http {
> else
listen ${{PROXY_LISTEN}};
> end
error_page 404 408 411 412 413 414 417 /kong_error_handler;
error_page 400 404 408 411 412 413 414 417 /kong_error_handler;
error_page 500 502 503 504 /kong_error_handler;

access_log logs/access.log;
Expand Down

0 comments on commit a0abe84

Please sign in to comment.