2

I am having an issue where some of my requests we perform are failing over cellular network. I have isolated a specific case which occurs every time. I begin with a POST and then follow it with a PATCH which results in the following error:

<-- HTTP FAILED: java.net.ProtocolException: Unexpected status line: <html>

This does not occur when on Wifi and other cell phone networks. My cell phone provider uses an APN which I believe is causing this issue.

Both requests expect JSON responses so seeing an html tag is very strange. We have checked the server logs and it is processing the second request successfully and does not show any issue. My understanding through reading other posts is that this has to do with the thread pool becoming corrupt from previous requests. A solution which fixed the problem was adding the following header connection: close but this is not an acceptable permanent solution.

We are currently using standard HTTP. We theorize that once we switch to HTTPS the APN would not be able to tamper with anything and thus this problem will resolve itself. Until that time though we are looking for a solution.

My question: How do we solve the issue of these failing requests? Are we on the right track in assuming it was the networks APN?

Response headers from POST that occurred before failing patch.

D/OkHttp: Server: nginx/1.8.1
D/OkHttp: Date: Wed, 22 Jun 2016 19:55:16 GMT
D/OkHttp: Content-Type: application/json;charset=UTF-8
D/OkHttp: Expires: 0
D/OkHttp: Cache-Control: no-cache, no-store, max-age=0, must-revalidate
D/OkHttp: Access-Control-Allow-Headers: x-requested-with,accept,content-  type,authorization
D/OkHttp: X-XSS-Protection: 1; mode=block
D/OkHttp: Pragma: no-cache
D/OkHttp: X-Frame-Options: DENY
D/OkHttp: Access-Control-Allow-Origin: *
D/OkHttp: X-Content-Type-Options: nosniff
D/OkHttp: Access-Control-Max-Age: 3600
D/OkHttp: Access-Control-Allow-Methods: POST, GET, PUT, PATCH, OPTIONS,   DELETE
D/OkHttp: Transfer-Encoding: chunked
D/OkHttp: Proxy-Connection: keep-alive
D/OkHttp: {"id":970,"type":"SMS","subject":"+1555555555","authenticationToken":"CTUQ7QuKJs1l58ji6OnDPJY6UGKuTBU2VF"}
wesjpaul
  • 240
  • 1
  • 9

0 Answers0