Created attachment 38450 [details] h2_proxy_session.patch Hi I found bug in http2 proxy. Content-Type header is not set correctly if served file name match with mime.types With simple http proxy it's handle via `mod_proxy_http.c:1302-1304` I can reproduce this bug with a front httpd proxying to an other httpd that serving php files. Here my test case First httpd server: `100-httpd-proxy.conf` > <VirtualHost *:${HTTP_PORT}> > ServerName localhost > > ProxyPreserveHost On > > # I use h2c instead h2 for test case for convenient but bug append also with h2 > # I use docker containers, so httpd DNS point to second server > ProxyPass /h2c/ h2c://httpd/ > ProxyPassReverse /h2c/ http://httpd/ > > ProxyPass /h11/ http://httpd/ > ProxyPassReverse /h11/ http://httpd/ > </VirtualHost> Second httpd server: `100-httpd.conf` > <VirtualHost *:${HTTP_PORT}> > ServerName localhost > > DocumentRoot /srv/httpd/app > > <Directory /srv/httpd/app> > Require all granted > </Directory> > > ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://php:9000/srv/httpd/app/$1 > </VirtualHost> `/srv/httpd/app/info.php` and `/srv/httpd/app/info.conf.php` > <?php > phpinfo(); > % curl -w "%{content_type}\n" -so /dev/null 'http://localhost/h11/info.php' >> text/html; charset=UTF-8 > % curl -w "%{content_type}\n" -so /dev/null 'http://localhost/h11/info.conf.php' >> text/html; charset=UTF-8 > % curl -w "%{content_type}\n" -so /dev/null 'http://localhost/h2c/info.php' >> text/html; charset=UTF-8 > % curl -w "%{content_type}\n" -so /dev/null 'http://localhost/h2c/info.conf.php' >> text/plain I patch `h2_proxy_session.c` to have same behaviours as http1.1 proxy After rebuild with patch I have > % curl -w "%{content_type}\n" -so /dev/null 'http://localhost/h11/info.php' >> text/html; charset=UTF-8 > % curl -w "%{content_type}\n" -so /dev/null 'http://localhost/h11/info.conf.php' >> text/html; charset=UTF-8 > % curl -w "%{content_type}\n" -so /dev/null 'http://localhost/h2c/info.php' >> text/html; charset=UTF-8 > % curl -w "%{content_type}\n" -so /dev/null 'http://localhost/h2c/info.conf.php' >> text/html; charset=UTF-8
Thanks Jérôme for finding this and writing a patch. I added this to trunk as r1906051 and propose it for backport to the next 2.4.x release.