mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 17:59:34 +00:00
Bug 1286554 - Remove network.http.keep_empty_response_headers_as_empty_string. r=jduell
MozReview-Commit-ID: 3b1Gpi6tit0
This commit is contained in:
parent
769d17f306
commit
7acd2dd485
@ -1759,12 +1759,6 @@ pref("network.http.tcp_keepalive.long_lived_idle_time", 600);
|
|||||||
pref("network.http.enforce-framing.http1", false); // should be named "strict"
|
pref("network.http.enforce-framing.http1", false); // should be named "strict"
|
||||||
pref("network.http.enforce-framing.soft", true);
|
pref("network.http.enforce-framing.soft", true);
|
||||||
|
|
||||||
// If it is set to false, headers with empty value will not appear in the header
|
|
||||||
// array - behavior as it used to be. If it is true: empty headers coming from
|
|
||||||
// the network will exist in header array as empty string. Call SetHeader with
|
|
||||||
// an empty value will still delete the header.(Bug 6699259)
|
|
||||||
pref("network.http.keep_empty_response_headers_as_empty_string", true);
|
|
||||||
|
|
||||||
// Max size, in bytes, for received HTTP response header.
|
// Max size, in bytes, for received HTTP response header.
|
||||||
pref("network.http.max_response_header_size", 393216);
|
pref("network.http.max_response_header_size", 393216);
|
||||||
|
|
||||||
|
@ -249,7 +249,6 @@ nsHttpHandler::nsHttpHandler()
|
|||||||
, mTCPKeepaliveLongLivedEnabled(false)
|
, mTCPKeepaliveLongLivedEnabled(false)
|
||||||
, mTCPKeepaliveLongLivedIdleTimeS(600)
|
, mTCPKeepaliveLongLivedIdleTimeS(600)
|
||||||
, mEnforceH1Framing(FRAMECHECK_BARELY)
|
, mEnforceH1Framing(FRAMECHECK_BARELY)
|
||||||
, mKeepEmptyResponseHeadersAsEmtpyString(false)
|
|
||||||
, mDefaultHpackBuffer(4096)
|
, mDefaultHpackBuffer(4096)
|
||||||
, mMaxHttpResponseHeaderSize(393216)
|
, mMaxHttpResponseHeaderSize(393216)
|
||||||
, mFocusedWindowTransactionRatio(0.9f)
|
, mFocusedWindowTransactionRatio(0.9f)
|
||||||
@ -1848,14 +1847,6 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PREF_CHANGED(HTTP_PREF("keep_empty_response_headers_as_empty_string"))) {
|
|
||||||
rv = prefs->GetBoolPref(HTTP_PREF("keep_empty_response_headers_as_empty_string"),
|
|
||||||
&cVar);
|
|
||||||
if (NS_SUCCEEDED(rv)) {
|
|
||||||
mKeepEmptyResponseHeadersAsEmtpyString = cVar;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PREF_CHANGED(HTTP_PREF("spdy.hpack-default-buffer"))) {
|
if (PREF_CHANGED(HTTP_PREF("spdy.hpack-default-buffer"))) {
|
||||||
rv = prefs->GetIntPref(HTTP_PREF("spdy.default-hpack-buffer"), &val);
|
rv = prefs->GetIntPref(HTTP_PREF("spdy.default-hpack-buffer"), &val);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
@ -365,11 +365,6 @@ public:
|
|||||||
|
|
||||||
void ShutdownConnectionManager();
|
void ShutdownConnectionManager();
|
||||||
|
|
||||||
bool KeepEmptyResponseHeadersAsEmtpyString() const
|
|
||||||
{
|
|
||||||
return mKeepEmptyResponseHeadersAsEmtpyString;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t DefaultHpackBuffer() const
|
uint32_t DefaultHpackBuffer() const
|
||||||
{
|
{
|
||||||
return mDefaultHpackBuffer;
|
return mDefaultHpackBuffer;
|
||||||
@ -594,13 +589,6 @@ private:
|
|||||||
|
|
||||||
nsCOMPtr<nsIRequestContextService> mRequestContextService;
|
nsCOMPtr<nsIRequestContextService> mRequestContextService;
|
||||||
|
|
||||||
// If it is set to false, headers with empty value will not appear in the
|
|
||||||
// header array - behavior as it used to be. If it is true: empty headers
|
|
||||||
// coming from the network will exits in header array as empty string.
|
|
||||||
// Call SetHeader with an empty value will still delete the header.
|
|
||||||
// (Bug 6699259)
|
|
||||||
bool mKeepEmptyResponseHeadersAsEmtpyString;
|
|
||||||
|
|
||||||
// The default size (in bytes) of the HPACK decompressor table.
|
// The default size (in bytes) of the HPACK decompressor table.
|
||||||
uint32_t mDefaultHpackBuffer;
|
uint32_t mDefaultHpackBuffer;
|
||||||
|
|
||||||
|
@ -158,18 +158,6 @@ nsHttpHeaderArray::SetHeaderFromNet(nsHttpAtom header,
|
|||||||
LookupEntry(header, &entry);
|
LookupEntry(header, &entry);
|
||||||
|
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
if (value.IsEmpty()) {
|
|
||||||
if (!gHttpHandler->KeepEmptyResponseHeadersAsEmtpyString() &&
|
|
||||||
!TrackEmptyHeader(header)) {
|
|
||||||
LOG(("Ignoring Empty Header: %s\n", header.get()));
|
|
||||||
if (response) {
|
|
||||||
// Set header as original but not as response header.
|
|
||||||
return SetHeader_internal(header, headerNameOriginal, value,
|
|
||||||
eVarietyResponseNetOriginal);
|
|
||||||
}
|
|
||||||
return NS_OK; // ignore empty headers by default
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HeaderVariety variety = eVarietyRequestOverride;
|
HeaderVariety variety = eVarietyRequestOverride;
|
||||||
if (response) {
|
if (response) {
|
||||||
variety = eVarietyResponseNetOriginalAndResponse;
|
variety = eVarietyResponseNetOriginalAndResponse;
|
||||||
|
@ -166,9 +166,6 @@ private:
|
|||||||
bool IsSingletonHeader(nsHttpAtom header);
|
bool IsSingletonHeader(nsHttpAtom header);
|
||||||
// Header cannot be merged, and subsequent values should be ignored
|
// Header cannot be merged, and subsequent values should be ignored
|
||||||
bool IsIgnoreMultipleHeader(nsHttpAtom header);
|
bool IsIgnoreMultipleHeader(nsHttpAtom header);
|
||||||
// For some headers we want to track empty values to prevent them being
|
|
||||||
// combined with non-empty ones as a CRLF attack vector
|
|
||||||
bool TrackEmptyHeader(nsHttpAtom header);
|
|
||||||
|
|
||||||
// Subset of singleton headers: should never see multiple, different
|
// Subset of singleton headers: should never see multiple, different
|
||||||
// instances of these, else something fishy may be going on (like CLRF
|
// instances of these, else something fishy may be going on (like CLRF
|
||||||
@ -255,14 +252,6 @@ inline bool nsHttpHeaderArray::IsIgnoreMultipleHeader(nsHttpAtom header)
|
|||||||
return header == nsHttp::Strict_Transport_Security;
|
return header == nsHttp::Strict_Transport_Security;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
|
||||||
nsHttpHeaderArray::TrackEmptyHeader(nsHttpAtom header)
|
|
||||||
{
|
|
||||||
return header == nsHttp::Content_Length ||
|
|
||||||
header == nsHttp::Location ||
|
|
||||||
header == nsHttp::Access_Control_Allow_Origin;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline MOZ_MUST_USE nsresult
|
inline MOZ_MUST_USE nsresult
|
||||||
nsHttpHeaderArray::MergeHeader(nsHttpAtom header,
|
nsHttpHeaderArray::MergeHeader(nsHttpAtom header,
|
||||||
nsEntry *entry,
|
nsEntry *entry,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user