jcayzacJ
Deno3y ago
5 replies
jcayzac

std/http/server: URI too long —how to avoid loading those?

Using https://deno.land/std@0.194.0/http/server.ts, is there a way to reject long URIs before they are loaded in memory? I have a middleware that responds with 414 URI Too Long when the URI length is > 8192, but this only saves me from the cost of parsing that thing —it's still already loaded in memory even if it's 1MB in size.
How can I get the server to close the connection when the URI grows beyond 8k instead?
Was this page helpful?