When a tool is emitting an error page in response, the proxy is currently replacing the response with a error. The original headers and body are suppressed.
This obscures a lot of errors and makings debugging virtually impossible.
Example file:
<?php http_response_code( 500 ); header( 'Content-Type: text/html; charset=utf-8' ); ?><!DOCTYPE html> <html> <meta charset="utf-8"> <title>Custom error</title> <body> <h1>Cannot connect to example.db</h1> </body> </html>
Hosted at https://tools.wmflabs.org/orphantalk/test.php
In response to a POST request, the proxy serves a generic nginx "400 Bad Request" page.
Example:
curl 'https://tools.wmflabs.org/orphantalk/test.php' --data 'x' -i -v [..] > POST /orphantalk/test.php HTTP/1.1 > User-Agent: curl/7.37.1 > Host: tools.wmflabs.org > Accept: */* > Content-Length: 1 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 1 out of 1 bytes HTTP/1.1 500 Internal Server Error Server: nginx/1.4.6 (Ubuntu) Date: Wed, 24 Jun 2015 08:31:11 GMT Content-Type: text/html Content-Length: 349 Connection: close <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>400 - Bad Request</title> </head> <body> <h1>400 - Bad Request</h1> </body> </html>
In response to a GET request, it serves a ToolLabs-style "Internal error" page.
> GET /orphantalk/test.php HTTP/1.1 HTTP/1.1 500 Internal Server Error Server: nginx/1.4.6 (Ubuntu) Date: Wed, 24 Jun 2015 08:57:37 GMT Content-Type: text/html Transfer-Encoding: chunked Connection: close X-Powered-By: PHP/5.5.9-1ubuntu4.9 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Tool Labs</title> <meta charset="utf-8" /> <meta name="title" content="Tool Labs" /> <meta name="description" content="This is the Tool Labs project for community-developed tools assisting the Wikimedia projects." /> [..]