One of our servant API endpoints specifies the Cookie header in the request, and so servant-elm happily generates elm code to set that header. This code throws a js runtime error.
Turns out "Cookie" is one of a list of forbidden header names that can't be set programmatically. The browser sets the cookie header automatically, I'm not sure about all the others.
This patch currently just filters any headers matching "Cookie" out of the list comprehensions that generate types, header args, and Http function calls.
I'm more than happy to extend it to work with all the forbidden headers, and/or implement it in a different style if you prefer.
One of our servant API endpoints specifies the Cookie header in the request, and so servant-elm happily generates elm code to set that header. This code throws a js runtime error.
Turns out "Cookie" is one of a list of forbidden header names that can't be set programmatically. The browser sets the cookie header automatically, I'm not sure about all the others.
This patch currently just filters any headers matching "Cookie" out of the list comprehensions that generate types, header args, and Http function calls.
I'm more than happy to extend it to work with all the forbidden headers, and/or implement it in a different style if you prefer.