Bug 1286554 - Remove network.http.keep_empty_response_headers_as_empty_string. r=jduell

MozReview-Commit-ID: 3b1Gpi6tit0
This commit is contained in:
Thomas Wisniewski 2016-07-13 10:40:29 -04:00
parent 769d17f306
commit 7acd2dd485
5 changed files with 0 additions and 50 deletions

View File

@ -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.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.
pref("network.http.max_response_header_size", 393216);

View File

@ -249,7 +249,6 @@ nsHttpHandler::nsHttpHandler()
, mTCPKeepaliveLongLivedEnabled(false)
, mTCPKeepaliveLongLivedIdleTimeS(600)
, mEnforceH1Framing(FRAMECHECK_BARELY)
, mKeepEmptyResponseHeadersAsEmtpyString(false)
, mDefaultHpackBuffer(4096)
, mMaxHttpResponseHeaderSize(393216)
, 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"))) {
rv = prefs->GetIntPref(HTTP_PREF("spdy.default-hpack-buffer"), &val);
if (NS_SUCCEEDED(rv)) {

View File

@ -365,11 +365,6 @@ public:
void ShutdownConnectionManager();
bool KeepEmptyResponseHeadersAsEmtpyString() const
{
return mKeepEmptyResponseHeadersAsEmtpyString;
}
uint32_t DefaultHpackBuffer() const
{
return mDefaultHpackBuffer;
@ -594,13 +589,6 @@ private:
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.
uint32_t mDefaultHpackBuffer;

View File

@ -158,18 +158,6 @@ nsHttpHeaderArray::SetHeaderFromNet(nsHttpAtom header,
LookupEntry(header, &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;
if (response) {
variety = eVarietyResponseNetOriginalAndResponse;

View File

@ -166,9 +166,6 @@ private:
bool IsSingletonHeader(nsHttpAtom header);
// Header cannot be merged, and subsequent values should be ignored
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
// 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;
}
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
nsHttpHeaderArray::MergeHeader(nsHttpAtom header,
nsEntry *entry,