mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 758973 - Make handling of status code 308 more consistent. r=bsmith
This commit is contained in:
parent
ec8c04607a
commit
9d97b3ceb2
@ -286,3 +286,10 @@ nsHttp::ParseInt64(const char *input, const char **next, int64_t *r)
|
||||
*next = input;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
nsHttp::IsPermanentRedirect(PRUint32 httpStatus)
|
||||
{
|
||||
return httpStatus == 301 || httpStatus == 308;
|
||||
}
|
||||
|
||||
|
@ -180,6 +180,9 @@ struct nsHttp
|
||||
return ParseInt64(input, &next, result) && *next == '\0';
|
||||
}
|
||||
|
||||
// Return whether the HTTP status code represents a permanent redirect
|
||||
static bool IsPermanentRedirect(PRUint32 httpStatus);
|
||||
|
||||
// Declare all atoms
|
||||
//
|
||||
// The atom names and values are stored in nsHttpAtomList.h and are brought
|
||||
|
@ -4101,7 +4101,7 @@ nsHttpChannel::ContinueProcessRedirectionAfterFallback(nsresult rv)
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
uint32_t redirectFlags;
|
||||
if (mRedirectType == 301) // Moved Permanently
|
||||
if (nsHttp::IsPermanentRedirect(mRedirectType))
|
||||
redirectFlags = nsIChannelEventSink::REDIRECT_PERMANENT;
|
||||
else
|
||||
redirectFlags = nsIChannelEventSink::REDIRECT_TEMPORARY;
|
||||
|
@ -290,7 +290,7 @@ nsHttpResponseHead::ComputeFreshnessLifetime(uint32_t *result) const
|
||||
}
|
||||
|
||||
// These responses can be cached indefinitely.
|
||||
if ((mStatus == 300) || (mStatus == 301)) {
|
||||
if ((mStatus == 300) || nsHttp::IsPermanentRedirect(mStatus)) {
|
||||
*result = uint32_t(-1);
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user