-
Try out the new Jake: AI Coding Assistant for LabVIEW!
Get answers to questions about LabVIEW and discuss your code.
Details
After parsing, HTTP response headers are apparently stored in a "dictionary" as named variant attributes. This is problematic when a response contains multiple headers with the same name but different values. For example, the sever can send multiple Set-Cookie headers containing different cookies rather than a single Set-Cookie header with a cookie list and the HTTP client is supposed to keep track of them all. The current implementation forces uniquely named entries in the header dictionary (as named variant attributes), so if the server responds with multiple headers with the same name, only the last of them is preserved. I consider this a bug rather than a feature request because it makes parsing a response with multiple headers with the same name unreliable.
This requires fixing the dictionary implementation to support multiple entries with the same name, possibly by prepending a unique ID to the name in the dictionary and splitting it off when the header name is queried (at least that's how I quickly hacked a workaround together). Returning all headers from the dictionary is then straight-forward, but the function/method to query a header from the dictionary by name has to return a string array (in case there are several headers with the same name), which might break some backwards compatibility.
Please sign in to leave a comment.