mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1230353: P1. Ensure type and subtype of MIME are lowercase. r=bz
As per RFC 2616 section 3.7, which states "The type, subtype, and parameter attribute names are case-insensitive". So ensure the type and subtype are always lower-case as all our comparisons assume that they are.
This commit is contained in:
parent
b2545f9af0
commit
5800cccc88
@ -17,10 +17,7 @@ public:
|
||||
~nsContentTypeParser();
|
||||
|
||||
nsresult GetParameter(const char* aParameterName, nsAString& aResult);
|
||||
nsresult GetType(nsAString& aResult)
|
||||
{
|
||||
return GetParameter(nullptr, aResult);
|
||||
}
|
||||
nsresult GetType(nsAString& aResult);
|
||||
|
||||
private:
|
||||
NS_ConvertUTF16toUTF8 mString;
|
||||
|
@ -6057,6 +6057,15 @@ nsContentTypeParser::GetParameter(const char* aParameterName, nsAString& aResult
|
||||
aResult);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsContentTypeParser::GetType(nsAString& aResult)
|
||||
{
|
||||
nsresult rv = GetParameter(nullptr, aResult);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsContentUtils::ASCIIToLower(aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
||||
bool
|
||||
|
Loading…
Reference in New Issue
Block a user