Skip to content

Commit

Permalink
Remove 418 error code (#1134)
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Shumilov <[email protected]>
  • Loading branch information
PetrShumilov authored Nov 11, 2024
1 parent 6472cf3 commit ab36704
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 0 additions & 5 deletions server/php-engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,11 +599,6 @@ int hts_func_execute(connection *c, int op) {
qGetLen = 0;
}

// TODO drop it?
if (qUriLen >= 200) {
return -418;
}

vkprintf (1, "start response processing on fd %d\n", c->fd);

const char *query_type_str = nullptr;
Expand Down
6 changes: 2 additions & 4 deletions tests/python/tests/http_server/test_request_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ def test_query_limit(self):
self.assertEqual(resp.status_code, 200)
self.assertEqual(resp.json()["REQUEST_URI"], uri)

resp = self.kphp_server.http_get(uri="/{}".format("a" * 200))
self.assertEqual(resp.status_code, 418)

uri = "/test_limits?" + self._get_rand_str(15000)
resp = self.kphp_server.http_get(uri)
self.assertEqual(resp.status_code, 200)
self.assertEqual(resp.json()["REQUEST_URI"], uri)

resp = self.kphp_server.http_get(uri="/{}".format("a" * 17000))
# Base on MAX_HTTP_HEADER_QUERY_WORD_SIZE 16 * 1024
resp = self.kphp_server.http_get(uri="/{}".format(("a" * (16 * 1024))))
self.assertEqual(resp.status_code, 414)

resp = self.kphp_server.http_get(uri="/a?{}".format("a" * 17000))
Expand Down

0 comments on commit ab36704

Please sign in to comment.