http icon indicating copy to clipboard operation
http copied to clipboard

Add function to split comma-separated fields

Open trowski opened this issue 5 years ago • 2 comments

Useful when all you care about is splitting on commas, not generating key-value pairs.

@kelunik Can you review the regex to make sure it makes sense.

trowski avatar Apr 23 '20 18:04 trowski

@trowski Doesn't parseFieldValueComponents do already what you're trying to implement here?

kelunik avatar Apr 23 '20 19:04 kelunik

In a manner of speaking, but it splits headers like 'permessage-deflate; client_max_window_bits=15; server_max_window_bits=15, some-other-extension' into [['permessage-deflate; client_max_window_bits', '15; server_max_window_bits=15'], ['some-other-extension', '']], which isn't exactly ideal. This function would parse the header to simply ['permessage-deflate; client_max_window_bits=15; server_max_window_bits=15', 'some-other-extension'].

trowski avatar Apr 24 '20 04:04 trowski