Old apps use HTTP Socket to check for updates; no longer works

The new versions of my apps use more modern ways of checking to see if there are updates.

Simply put, the old apps use a GET HTTP socket to check a .text file on the website and it compares it to a number hardcoded in the app. This is what my website is giving back:

400 Bad Request

Bad Request

Your browser sent a request that this server could not understand.

Is there anything I can do on the server side to serve this request?

Check your error logs for why the server is considering the request bad.

It may also be the server is now rejecting all non-HTTPS requests. Or HTTP 1.0 requests. Whether and how you can override that on the server to allow the specific HTTP requests for the updates will likely depend on the server being used, and perhaps a front-end llke HaProxy or NginX. So exactly what you would need to change on the server is beyond the scope of this forum. Or at least need much more information on the server configuration and error logs.

A few months ago I changed from HTTPSSocket to URLConnection in a similar use case, where the client moved stuff behind CloudFare and some stuff broke. I discovered URLConnection worked, so just changed to it instead of seeing if any server config changes could be tweaked.

I looked at my server logs and the error is 400 and 226.

The issue is that I am now using URLConnection, but all the apps out there in use are using HTTPSocket and there is no way to let them know an update is available.

See HTTPSocket, Apache and duplicate Host headers

1 Like

Mike D, it seems like there is nothing that can be done server side according to your post. I was hoping to redirect it to where it could access a HTTP 1.0 situation, but maybe that isn’t the case?

URLConnection uses whatever the underlying OS does and it’s very likely these days that http/1.0 is no longer there.

There could be several causes - you should check your code and see if you were adding the HOST header manually - if so, then I suspect it could be the same issue I was seeing (where an Apache upgrade decided that duplicate Host headers were now illegal).

If that’s not the situation, then I think suggestions by @Douglas_Handy suggesting some other possible issues.