Why does Safari does not allow trailing space in header value
HI,
I noticed that especially in safari if i made an ajax call say like :
headers : {"dsds" : "asdasdas "}
As this has a trailing space at the end... This will result in an exception.
What could be the reason for this.. As this is not happening for other browsers ??
Thanks
Web BrowsersjQuery
Last Comment
Julian Hansen
8/22/2022 - Mon
Julian Hansen
We need a context for this, a link and / or screen shot, a full description of the error and a look at the underlying code.
Rohit Bajaj
ASKER
Hi,
I have attached the screenshot of safari console tab. Here if i give a trailing space at the end of a request header it throws an exception otherwise it just runs fine... Screen-Shot-2016-10-06-at-11.11.17-A.png
Julian Hansen
Still not enough - we need to see the code.
Sidebar - is the space on the end necessary - why not simply trim it before sending.
Thats the whole code in the screenshot just create an xhr request and add an header with a trailing space at the end... It throws an error this does not happen in chrome.. or firefox...
Yes thats what i am planning to do just trim the space before sending....
Just wanted to know if there is any possible reason why safari has done that and not chrome...