title: Why does Chrome for iOS insert image/webp content-type?
body: <p>I have a mobile web app that is making an AJAX request via $.get().  The request succeeds for Safari iOS, but fails for Chrome for iOS with status 0 and statusText "error".</p>
  
  <p>Using tcpdump on my server, I can see that Safari sends/receives the following headers:</p>
  
  <pre><code>Accept: */*    (outgoing)
  
  Content-Type: text/plain;charset=ISO-8859-1    (returning)
  </code></pre>
  
  <p>Chrome for iOS adds a mime type of "image/webp" to the outgoing Accept: header and the Content-Type returned is "image/webp":</p>
  
  <pre><code>Accept: */*,image/webp  (outgoing)
  
  HTTP/1.1 200 OK
  Content-Type: image/webp   (returning)
  </code></pre>
  
  <p>Reading through the jQuery code, it looks like $.get() only parses certain content types in AJAX responses, so I'm thinking that an image mime type is just being rejected, resulting in the "error" status.</p>
  
  <p>In the request from Chrome for iOS as it arrives on my server, there's also this header:</p>
  
  <p>Via: 1.1 Chrome-Compression-Proxy</p>
  
  <p>...which indicates that Chrome for iOS has sent the request to a Google proxy server to service the request (info <a href="https://support.google.com/chrome/answer/3517349?hl=en" rel="nofollow" title="here">https://support.google.com/chrome/answer/3517349?hl=en</a>).  Seems like this proxy server is setting the extra content type, and somehow the content type is returned as image/webp on the way back?  The server code is RESTful Spring 3; I do set the content type as "text/plain" in the controller code, but somehow that's not being taken and it's still returning as "image/webp".</p>
  
  <p>Has anyone had a similar problem and found a solution for it?  I need to have a return Content-Type of "text/plain" to get the data back correctly to my app.  This request works correctly on Chrome for Android as well AFAIK, haven't done a tcpdump for that, but the app works correctly; only fails on Chrome for iOS.</p>