-
- Downloads
Fix URLs containing whitespace when GitLab used together with Apache
Turns off NoEscape flag. Adapted from https://gitlab.com/gitlab-org/gitlab-ce/issues/3163
- web-server/apache/gitlab-apache22.conf 1 addition, 1 deletionweb-server/apache/gitlab-apache22.conf
- web-server/apache/gitlab-apache24.conf 1 addition, 1 deletionweb-server/apache/gitlab-apache24.conf
- web-server/apache/gitlab-omnibus-apache22.conf 1 addition, 1 deletionweb-server/apache/gitlab-omnibus-apache22.conf
- web-server/apache/gitlab-omnibus-apache24.conf 1 addition, 1 deletionweb-server/apache/gitlab-omnibus-apache24.conf
- web-server/apache/gitlab-omnibus-ssl-apache22.conf 1 addition, 1 deletionweb-server/apache/gitlab-omnibus-ssl-apache22.conf
- web-server/apache/gitlab-omnibus-ssl-apache24.conf 1 addition, 1 deletionweb-server/apache/gitlab-omnibus-ssl-apache24.conf
- web-server/apache/gitlab-ssl-apache22.conf 1 addition, 1 deletionweb-server/apache/gitlab-ssl-apache22.conf
- web-server/apache/gitlab-ssl-apache24.conf 1 addition, 1 deletionweb-server/apache/gitlab-ssl-apache24.conf
-
Removing the NE (No Escape ) flag from RewriteRule breaks accessing projects with the GitLab API via NAMESPACE/PROJECT_NAME. For example, now the request /api/v3/projects/foo%2Fbar/repository/branches will be forwarded to /api/v3/projects/foo%252Fbar/repository/branches -- it will percent encode the percent encode. See https://gitlab.com/gitlab-org/gitlab-recipes/commit/e44ea041dde57b5075f738046ec6316613cb790a
-
cc @Zenti
-
I'm currently adding another rule for api requests where the NE flag is set, as well as fixing error documents not displaying (see #43 (closed)). Will add a merge request soon.
-
mentioned in merge request !52 (merged)
-
Are there other URLs containing percent encoded characters other than the api?
@jacobvosmaer @ayufan do you have any idea?
-
@andy_schmidt can you try with the latest config?
-
@axil can't think of any right now.
-
@axil this fixes my API issue... thanks for the fast response, much appreciated! (Though I haven't tried out file uploads)
-
It does not work with my url. Im using apache 2.4 with the latest
gitlab-omnibus-ssl-apache24.conf
configHere is an example: https://git.example.com/User/example/tree/master/test%20folder
-
I can verify your problem on a second GitLab instance I have recently set up, but not in my primary GitLab instance.
I found a solution for my second GitLab instance. In your
gitlab-omnibus-ssl-apache24.conf
file, can you replace the lineRewriteCond %{REQUEST_URI} ^/api/v3/.* [OR]
with
RewriteCond %{REQUEST_URI} ^/api/v3/.*
and try again?
Please report back whether that fixes your problem. If it does, I will submit it as a MR.
Edited by username-removed-17194