headers icon indicating copy to clipboard operation
headers copied to clipboard

feat: Provide a way to treat the cookie as bytes

Open Marwes opened this issue 4 years ago • 2 comments

In some instances there can be an unrelated, invalid cookie which prevents any cookies from being accessed as HeaderValue::to_str returns None due to non-ascii characters. By providing a way to access the cookie string as bytes there is an escape hatch to workaround this.

Marwes avatar May 21 '21 10:05 Marwes

Feel free to close this if it isn't wanted. Treating the cookie as raw bytes definitely leaves some ambiguity as to what the right thing to do is.

Marwes avatar May 21 '21 10:05 Marwes

i'd dont think this should be closed. i dont think this introduces ambiguity, as its nothing that happens by default. maybe if you want a "scarier" name you could call it "get_raw" instead. i think being able to gracefully handle cases such as you mentioned rather than fail completely is very useful.

VladimirBramstedt avatar Aug 09 '21 10:08 VladimirBramstedt