https://bz.apache.org/bugzilla/show_bug.cgi?id=66391

            Bug ID: 66391
           Summary: H2 not proxying Content-Type
           Product: Apache httpd-2
           Version: 2.4-HEAD
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: mod_http2
          Assignee: bugs@httpd.apache.org
          Reporter: jerome.billiras+apa...@gmail.com
  Target Milestone: ---

Created attachment 38450
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38450&action=edit
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

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscr...@httpd.apache.org
For additional commands, e-mail: bugs-h...@httpd.apache.org

Reply via email to