Cannot fetch author info due to incorrect server url prefix

Summary

Inside the Repository > Commits page, it displayed that failed to find the author info.

It says.

An error occurred fetching the project authors.

Steps to reproduce

Just upgraded to 12.10.2, and this error occured.

Looked it up in the Inspection Panel and found that the XHR request to https://example.com/autocomplete/users.json?project_id=10&active=true failed.

As a matter of fact, we are deploying the Gitlab CE version under the pathname. https://example.com/git/

And I found that the following URL was okay. https://example.com/git/autocomplete/users.json?project_id=10&active=true

Example Project

Any project.

What is the current bug behavior?

Happening

What is the expected correct behavior?

No warnings and normalized author list displayed.

Relevant logs and/or screenshots

Log in the Chrome Dev Tools Panel

Failed to load resource: the server responded with a status of 404 (Not Found)

Output of checks


      An error occurred fetching the project authors.
      

Results of GitLab environment info

System information
System:		Ubuntu 16.04
Current User:	git
Using RVM:	no
Ruby Version:	2.6.5p114
Gem Version:	2.7.10
Bundler Version:1.17.3
Rake Version:	12.3.3
Redis Version:	5.0.7
Git Version:	2.26.2
Sidekiq Version:5.2.7
Go Version:	unknown

GitLab information
Version:	12.10.2
Revision:	d90add1c62d
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	9.6.17
URL:		http://git.xc.../git
HTTP Clone URL:	http://git.xc.../git/some-group/some-project.git
SSH Clone URL:	git@git.xc...:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: 

GitLab Shell
Version:	12.2.0
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell
Git:		/opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 12.2.0 ? ... OK (12.2.0)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Internal API available: OK
Redis available via internal API: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Checking Reply by email ...

IMAP server credentials are correct? ... no
Exception: undefined method `message' for #<String:0x00007f02cbd33270>
Init.d configured correctly? ... skipped
MailRoom running? ... skipped

Checking Reply by email ... Finished


Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
Projects have namespace: ... 
2/1 ... yes
2/2 ... yes
2/4 ... yes
2/5 ... yes
2/8 ... yes
2/9 ... yes
2/10 ... yes
2/12 ... yes
2/13 ... yes
2/14 ... yes
2/15 ... yes
2/16 ... yes
2/17 ... yes
2/18 ... yes
2/19 ... yes
2/20 ... yes
2/21 ... yes
2/23 ... yes
2/24 ... yes
2/25 ... yes
2/26 ... yes
2/27 ... yes
2/28 ... yes
2/29 ... yes
2/30 ... yes
2/31 ... yes
2/32 ... yes
2/33 ... yes
2/34 ... yes
2/35 ... yes
2/36 ... yes
2/37 ... yes
2/38 ... yes
2/39 ... yes
21/46 ... yes
21/47 ... yes
21/48 ... yes
21/49 ... yes
21/51 ... yes
21/52 ... yes
21/53 ... yes
21/54 ... yes
21/55 ... yes
21/56 ... yes
21/57 ... yes
21/58 ... yes
21/59 ... yes
21/60 ... yes
21/61 ... yes
2/62 ... yes
2/63 ... yes
6/64 ... yes
2/65 ... yes
2/66 ... yes
2/67 ... yes
2/69 ... yes
2/70 ... yes
21/71 ... yes
21/72 ... yes
2/73 ... yes
21/75 ... yes
21/76 ... yes
2/79 ... yes
2/80 ... yes
21/81 ... yes
2/82 ... yes
2/83 ... yes
2/84 ... yes
2/85 ... yes
2/86 ... yes
2/87 ... yes
2/90 ... yes
2/92 ... yes
2/93 ... yes
2/94 ... yes
21/95 ... yes
2/97 ... yes
26/99 ... yes
26/100 ... yes
26/101 ... yes
26/102 ... yes
2/103 ... yes
2/104 ... yes
2/105 ... yes
2/106 ... yes
6/107 ... yes
2/108 ... yes
26/109 ... yes
2/110 ... yes
2/111 ... yes
2/112 ... yes
26/113 ... yes
2/114 ... yes
26/117 ... yes
2/119 ... yes
2/120 ... yes
26/121 ... yes
2/122 ... yes
21/124 ... yes
2/125 ... yes
2/126 ... yes
21/127 ... yes
21/128 ... yes
2/129 ... yes
2/130 ... yes
32/131 ... yes
35/133 ... yes
35/134 ... yes
2/135 ... yes
35/136 ... yes
2/137 ... yes
2/138 ... yes
2/139 ... yes
2/141 ... yes
2/142 ... yes
2/143 ... yes
2/144 ... yes
2/145 ... yes
2/146 ... yes
2/147 ... yes
2/149 ... yes
2/150 ... yes
2/151 ... yes
2/152 ... yes
21/153 ... yes
21/154 ... yes
21/155 ... yes
2/156 ... yes
42/157 ... yes
42/158 ... yes
42/159 ... yes
42/160 ... yes
42/161 ... yes
42/162 ... yes
42/163 ... yes
42/164 ... yes
21/165 ... yes
2/166 ... yes
2/167 ... yes
2/168 ... yes
2/169 ... yes
42/170 ... yes
2/171 ... yes
21/172 ... yes
2/173 ... yes
42/174 ... yes
2/175 ... yes
2/176 ... yes
42/177 ... yes
32/178 ... yes
2/179 ... yes
2/180 ... yes
42/181 ... yes
42/182 ... yes
42/183 ... yes
42/184 ... yes
2/186 ... yes
26/187 ... yes
42/188 ... yes
42/189 ... yes
42/190 ... yes
2/191 ... yes
2/192 ... yes
2/193 ... yes
26/194 ... yes
26/195 ... yes
26/196 ... yes
2/197 ... yes
2/198 ... yes
2/199 ... yes
2/200 ... yes
2/201 ... yes
2/202 ... yes
5/203 ... yes
29/204 ... yes
26/205 ... yes
2/206 ... yes
2/207 ... yes
2/208 ... yes
26/209 ... yes
26/210 ... yes
Redis version >= 4.0.0? ... yes
Ruby version >= 2.5.3 ? ... yes (2.6.5)
Git version >= 2.22.0 ? ... yes (2.26.2)
Git user has default SSH configuration? ... yes
Active users: ... 37
Is authorized keys file accessible? ... yes

Checking GitLab App ... Finished


Checking GitLab subtasks ... Finished

Possible fixes

Looks like a UI (Javascript) fix possible.

Use the URL from the configuration passed it, and not location.hostname.