HTTP request manipulation caused by img.src update

I am currently creating a hybrid mobile application (see phonegap / cordova) for iOS and Android and noticed that when updating the img.src URL of the image (which I often do), the HTTP http request looks like below.

My problem is that it does not include the entire important Accept header (Accept: /), so the server cannot load the image and returns (HTTP / 1.1 406 Not Acceptable). Chrome / iOS includes this Accept header in their HTTP requests when updating the img.src URL.

My question is: is there a way to add this header or do something that will include this header for future img.src updates?

Android Http Request:

GET /system/data/ba9320b8-e093-47a9-8858-c6343febf3ec/frame?t=1339017043002 HTTP/1.1
Host: MyHostName
Connection: keep-alive
User-Agent: Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F)
AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
Accept-Encoding: gzip,deflate
Accept-Language: en-US
Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7
Cookie: auth_token=0882f24f-04d7-4f05-9475-cfe2a94af5bf
+5
source share
1

Google, . Closure, PhoneGap ( , :)

HTTP-. xhr , setRequestHeader (param, value); , . , , .

, . Google Closure xhr ( ), . , jQuery .

$.ajax({
         url: "http://someurl",
         data: { signature: authHeader },
         type: "GET",
         beforeSend: function(xhr){xhr.setRequestHeader('X-Test-Header', 'test-value');}
         success: function() { alert('Success!' + authHeader); }
      });
+1

All Articles