Link to home
Start Free TrialLog in
Avatar of Rohit Bajaj
Rohit BajajFlag for India

asked on

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
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

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.
Avatar of 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
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...
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial