Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[http] add handling of bad request #419
This is meant to fix : denoland/deno#2346
It's not that pretty but ATM i haven't found any other way to do it.
So if, there is an issue in the request with malformed headers or encrypted due to HTTPS, an error is attached to the server request, if there is a respond of it the ServerResponse is automaticaly rewritten.
This fixes bad headers and wrong protocol (somehow). The problem with https is we got :
Note: i've noticed we have multiple set of
So i've exported ReadRequest to check if with malformed or unreadable headers it does not crash the server. Atm it only returns
Would it be revelant do declare a new Error type for server error and do all the handling of standard error messages in this place?
So i've ported the headers from : https://github.com/golang/go/blob/master/src/net/http/request_test.go#L428 as suggested.
Some tests case are commented because it has shown errors in our code which i'll fix in another PR.
EDIT: Reverted to regular error.