mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
fix test-http-head-request
This commit is contained in:
@@ -125,6 +125,10 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (httpResponseData->state & HttpResponseData<SSL>::HTTP_WROTE_TRANSFER_ENCODING_HEADER) {
|
||||
allowContentLength = false;
|
||||
}
|
||||
|
||||
/* if write was called and there was previously no Content-Length header set */
|
||||
if (httpResponseData->state & HttpResponseData<SSL>::HTTP_WRITE_CALLED && !(httpResponseData->state & HttpResponseData<SSL>::HTTP_WROTE_CONTENT_LENGTH_HEADER) && !httpResponseData->fromAncientRequest) {
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ struct HttpResponseData : AsyncSocketData<SSL>, HttpParser {
|
||||
HTTP_CONNECTION_CLOSE = 16, // used
|
||||
HTTP_WROTE_CONTENT_LENGTH_HEADER = 32, // used
|
||||
HTTP_WROTE_DATE_HEADER = 64, // used
|
||||
HTTP_WROTE_TRANSFER_ENCODING_HEADER = 128, // used
|
||||
};
|
||||
|
||||
/* Shared context pointer */
|
||||
|
||||
@@ -1038,6 +1038,11 @@ static void writeFetchHeadersToUWSResponse(WebCore::FetchHeaders& headers, uWS::
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent automatic Date header insertion when user provides one
|
||||
if (header.key == WebCore::HTTPHeaderName::TransferEncoding) {
|
||||
data->state |= uWS::HttpResponseData<isSSL>::HTTP_WROTE_TRANSFER_ENCODING_HEADER;
|
||||
}
|
||||
|
||||
// Prevent automatic Date header insertion when user provides one
|
||||
if (header.key == WebCore::HTTPHeaderName::Date) {
|
||||
data->state |= uWS::HttpResponseData<isSSL>::HTTP_WROTE_DATE_HEADER;
|
||||
|
||||
Reference in New Issue
Block a user