Topic on Project:Support desk

Jump to navigation Jump to search

Redirection fails in Webikit browsers with NSPOSIXErrorDomain: 100

Tomoki Uda (talkcontribs)

Dear maintainers,

Redirect 301, served under Apache 2.4, fails in Webkit browsers such as Safari on macOS, Google Chrome on iOS (iPad), and so on. This terrible behaviour affect many situations in which redirection is needed.

For example, when my mediawiki redirects from index.php?title=Special:Login to index.php?title=特別:ログイン, Safari says NSPOSIXErrorDomain: 100 and shows nothing other than the error message. Of course, there are no problems if I try redirection on other OS and browsers. By curling the same URL, I find out that the redirection response contains extra packets with the following message:

Excess found in a non pipelined read: excess = 20 url = /index.php (zero-length body)

although the Content-Length is 0. This is caused by compressing empty data in include/OutputHandler.php. If we do not perform the gzip compression in between ob_start and ob_end_flush, extra bytes do not appear, so redirection goes without any problems as expected. For this, I have confirmed that setting $wgDisableOutputCompression = false or commenting out the corresponding line in OutputHandler.php resolves the redirection error in Webkit browsers.

MediaWiki 1.35.0
PHP 7.4.3 (cgi-fcgi)
MySQL 5.7.29-log
ICU 50.2
  • Server version: Apache/2.4.6 (CentOS)
  • Safari 14.0 (15610., 15610) / MacOS Catalina 10.15.7

I also tried other environments as follows:

  • PHP 7.4.12 with php -S localhost:9000 on my local PC. No extra bytes. No redirection errors.
  • PHP 7.4.4 served under nginx 1.16.1. No extra bytes. No redirection errors.
  • Checking extra bytes in response by curl -i -v --compressed --http1.1 'http:// host : port /index.php?title=Special:Login'

So the problem (perhaps?) seems like specific to the combination with Apache 2.4. Note that some blog authors say that, when served by Apache 2.4, the error NSPOSIXErrorDomain: 100 can be resolved by Header unset Upgrade, but this did not work well for me. I think HTTP/2 Upgrade header has nothing to do with the redirection error in my situation.


Bawolff (talkcontribs)

hmm, there have now been several complaints about our gzip code causing problems under apache with http/2 enabled.

Peculiar Investor (talkcontribs)
Bawolff (talkcontribs)
Reply to "Redirection fails in Webikit browsers with NSPOSIXErrorDomain: 100"