# port mod_xsendfile



## ailmanki (Aug 17, 2016)

mod_xsendfile does by default drop the header "Content-Encoding". And unfortunately it does not add it either. So one cannot serve for example gzip files.
Quote from https://tn123.org/mod_xsendfile/beta/ :
_The Content-Encoding header - if present - will be dropped, as the module cannot know if it was set by intention of the programmer or the handler. E.g. php with output compression enabled will set this header, but the replacement file send via mod_xsendfile is most likely not compressed._​
So for first time I tried to modify a port, and luckily this was simple.
I simply uncommented this 2 lines in mod_xsendfile.c:

```
apr_table_unset(r->headers_out, "Content-Encoding");
apr_table_unset(r->err_headers_out, "Content-Encoding");
```

And its working as expected, the header I set is kept, and the Browser knows what todo with it.
So now I wonder, how do I get this patch into the world?
And probably this should be improved by either being optional in make configure, or an extra parameter for PHP, as it might break some apps relying on that.


----------



## SirDice (Aug 18, 2016)

ailmanki said:


> So now I wonder, how do I get this patch into the world?


Submit the patch, preferably upstream. If that's not possible you can submit it here: https://bugs.freebsd.org/bugzilla/query.cgi


----------

