Open Bug 1765290 Opened 2 years ago Updated 1 year ago

Figure out UTF8/UTF16 handling in early hint code

Categories

(Core :: Networking: HTTP, task, P3)

task

Tracking

()

People

(Reporter: manuel, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Currently early hints receive the link header as utf8 encoded string. This makes sense, because http headers are ASCII-encoded. Parsing the header string and using the header values require UTF16 however. It would be good if we could use just utf8-functions there.
https://phabricator.services.mozilla.com/D137885#inline-793476

Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]

It seems to me like the way forward is to change the encoding from utf16 to utf8 in the LinkHeader and all functions working with LinkHeader attributes (s/nsString/nsCString):

https://searchfox.org/mozilla-central/rev/3840d8109501fbebdf22212165ea15a391280dcb/netwerk/base/nsNetUtil.h#1005-1017,1025

struct LinkHeader {
  nsString mHref;
  nsString mRel;
  nsString mTitle;
  nsString mIntegrity;
  nsString mSrcset;
  nsString mSizes;
  nsString mType;
  nsString mMedia;
  nsString mAnchor;
  nsString mCrossOrigin;
  nsString mReferrerPolicy;
  nsString mAs;
...
};
Blocks: 1802501
No longer blocks: earlyhints
Priority: P2 → P3
Severity: S3 → N/A
You need to log in before you can comment on or make changes to this bug.