Search code examples
google-chromenetwork-protocolshttp2

HEAD requests fail after switching to HTTP/2


I have a strange problem after my webhost switched to HTTP/2.

Suddenly all HEAD requests to PHP pages cause an ERR_SPDY_PROTOCOL_ERROR in Chrome. This even happens when the file is empty. This only seems to happen in Chrome though, Postman and Lynx seem to be able to send the request just fine.

An example, entering the following in the console in Chrome (the test.php file is empty):

var http = new XMLHttpRequest();
http.open("HEAD", "https://play.asti.ga/api/test.php");
http.send();

returns the following error: HEAD https://play.asti.ga/api/test.php net::ERR_SPDY_PROTOCOL_ERROR The network tab also shows (failed). However, doing the same request to test.html does work like it should.

I contacted the webhost, and they claim that their configuration is fine, so I was wondering what I can do to fix this. The server runs on PHP/7.0.25


Solution

  • It did turn out to be a server problem, more specifically a problem with SuPHP in combination with HTTP/2.