Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Why does Safari does not allow trailing space in header value

Posted on 2016-10-02
5
Medium Priority
?
119 Views
Last Modified: 2016-10-16
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
0
Comment
Question by:Rohit Bajaj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 59

Expert Comment

by:Julian Hansen
ID: 41826064
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.
0
 

Author Comment

by:Rohit Bajaj
ID: 41831191
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
0
 
LVL 59

Expert Comment

by:Julian Hansen
ID: 41831216
Still not enough - we need to see the code.

Sidebar - is the space on the end necessary - why not simply trim it before sending.
0
 

Author Comment

by:Rohit Bajaj
ID: 41843224
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...
0
 
LVL 59

Accepted Solution

by:
Julian Hansen earned 2000 total points
ID: 41843354
This bug report seems to deal with the issue

https://github.com/jquery/jquery/issues/3055

Basically it says that a space should be allowed but that there does appear to be an issue with Safari so for now I would just trim the value.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question