mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 02:17:34 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
de0b4ac202
15 changed files with 437 additions and 77 deletions
|
|
@ -245,6 +245,18 @@ nsHttp::GetProtocolVersion(uint32_t pv)
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void
|
||||
nsHttp::TrimHTTPWhitespace(const nsACString& aSource, nsACString& aDest)
|
||||
{
|
||||
nsAutoCString str(aSource);
|
||||
|
||||
// HTTP whitespace 0x09: '\t', 0x0A: '\n', 0x0D: '\r', 0x20: ' '
|
||||
static const char kHTTPWhitespace[] = "\t\n\r ";
|
||||
str.Trim(kHTTPWhitespace);
|
||||
aDest.Assign(str);
|
||||
}
|
||||
|
||||
// static
|
||||
bool
|
||||
nsHttp::IsReasonableHeaderValue(const nsACString &s)
|
||||
|
|
|
|||
|
|
@ -148,6 +148,10 @@ struct nsHttp
|
|||
static inline bool IsValidToken(const nsACString &s) {
|
||||
return IsValidToken(s.BeginReading(), s.EndReading());
|
||||
}
|
||||
|
||||
// Strip the leading or trailing HTTP whitespace per fetch spec section 2.2.
|
||||
static void TrimHTTPWhitespace(const nsACString& aSource,
|
||||
nsACString& aDest);
|
||||
|
||||
// Returns true if the specified value is reasonable given the defintion
|
||||
// in RFC 2616 section 4.2. Full strict validation is not performed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue