Move to default headers
Set the $httpProvider.defaults.headers.
Overwrite the default on upload image.
For more information see:
https://docs.angularjs.org/api/ng/service/$http#setting-http-headers
Removed "Content-Type" on GET request.
There is no "Content-Type" on a GET request.
Content-Type is only used with POST, PUT, and PATCH requests. See:
https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
Tested: Manual regression test of Web UI. Performed tasks such as
firmware image upload, booting the server, and deleting
event logs.
Change-Id: I9217ba3eab40d40a331322d0848bdc5c5ca93767
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/index.js b/app/index.js
index 7eff968..1e11804 100644
--- a/app/index.js
+++ b/app/index.js
@@ -122,6 +122,18 @@
'$httpProvider',
function($httpProvider) {
$httpProvider.interceptors.push('apiInterceptor');
+ $httpProvider.defaults.headers.common = {
+ 'Accept': 'application/json'
+ };
+ $httpProvider.defaults.headers.post = {
+ 'Content-Type': 'application/json'
+ };
+ $httpProvider.defaults.headers.put = {
+ 'Content-Type': 'application/json'
+ };
+ $httpProvider.defaults.headers.patch = {
+ 'Content-Type': 'application/json'
+ };
}
])
.run([