HTTP 400 error when downloading files

I try to download a single file, like docx or pptx, from web page. It will return http 400 bad request error if the file name contains spaces. If the file name contains no spaces, it will work fine. Does any one know meet this issue? My gitlab version is 8.8.4

Do you get this when you type the URL by hand, or do you click a link from the GitLab web interface?

Hi kohenkatz,

I have found the root cause. My http RewriteRule is configured as:
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]

NE means to prevent mod_rewrite from applying hexcode escaping of special characters in the result of the rewrite. I removed NE, then all works well now.

1 Like

In the example Apache config in the Recipes repository, you will see that there are two rewrite rules - one that uses the NE flag, and one that does not. You should ensure that you have yours set up similar to the example.