Orange project Chrome is running normally, Safari reports error: syntax error: DOM exception 12
Stackoverflow search problem: http://stackoverflow.com/questions/34620703/error-syntaxerror-dom-exception-12-setrequestheadernative-code
Reason: there cannot be spaces before and after attribute values in Ajax HTTP request headers
Project code:
config.headers.Authorization = ['Bearer ', $rootScope.JWT].join('');
Because the value of $rootscope.jwt may not exist, authorization is equal to ‘bearer’. Repair and conditional judgment are as follows:
if($rootScope.JWT) {
config.headers.Authorization = ['Bearer ', $rootScope.JWT].join('');
}
Similar Posts:
- xhr.js:108 Refused to set unsafe header “Cookie”
- Call JIRA API to create issue prompt xsrf check failed
- [reprint] extjs sets the timeout of Ajax request
- [Solved] HttpClient HttpRequestHeaders.From Error: The specified value is not a valid ‘From’ header string.
- MySQL error message: subquery returns more than 1 row and its solution
- “bug” IE8 ajax 25253338169no transport
- JQuery Ajax crossdomain cannot be used in IE [How to Solve]
- [Solved] NetworkError: Failed to execute ‘send’ on ‘XMLHttpRequest’: Failed to load xxxx
- After deploying Django Apache in win10, an error is reported: authentication credentials were not provided
- How to Solve Python Error: “HTTP Error 403: Forbidden”