API call to fetch issues when adding dependent issue doesn't take ROOT_URL into account #2564

Closed
opened 2025-11-02 04:40:37 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @markusamshove on GitHub (Nov 23, 2018).

  • Gitea version (or commit ref): 1.6.0
  • Database (use [x]):
    • PostgreSQL
    • [X ] MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

I wanted to try out issue dependencies and when clicking wihtin the dropbox, or typing in an issue, I get the response:

There was an error contacting the server

In the JavaScript console I can see the following error:

API: Server gave an error: error /scm/api/v1/repos/scm/MY_USER/MY_REPO/issues?q=

The problem is, that my ROOT_URL looks like this:

https://mydomain.com/scm

and therefore the API call doesn't find the correct endpoint (see the additional scm after repos/).

It seems like the URL-building part of the API call doesn't take ROOT_URL into account, or simply uses everything after DOMAIN to concat it to v1/repos/

I currently see no workaround which I can do on my side to work around this at the moment.

Screenshots

grafik

Originally created by @markusamshove on GitHub (Nov 23, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.6.0 - Database (use `[x]`): - [ ] PostgreSQL - [X ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [X] No - [ ] Not relevant ## Description I wanted to try out issue dependencies and when clicking wihtin the dropbox, or typing in an issue, I get the response: `There was an error contacting the server` In the JavaScript console I can see the following error: `API: Server gave an error: error /scm/api/v1/repos/scm/MY_USER/MY_REPO/issues?q=` The problem is, that my `ROOT_URL` looks like this: `https://mydomain.com/scm` and therefore the API call doesn't find the correct endpoint (see the additional `scm` after `repos/`). It seems like the URL-building part of the API call doesn't take `ROOT_URL` into account, or simply uses everything after `DOMAIN` to concat it to `v1/repos/` I currently see no workaround which I can do on my side to work around this at the moment. ## Screenshots ![grafik](https://user-images.githubusercontent.com/2401875/48941479-f944ef00-ef1b-11e8-8223-b28b2be1cf10.png)
GiteaMirror added the type/bug label 2025-11-02 04:40:37 -06:00
Author
Owner

@markusamshove commented on GitHub (Nov 23, 2018):

I've found the API call here and it seems that the #repolink element in my HTML does have the /scm suffix.

I'm not sure what the correct way is here, either have a different #repolink (which might break other stuff) or have the call relativize the URL correctly taking ROOT_URL into account

@markusamshove commented on GitHub (Nov 23, 2018): I've found the API call [here](https://github.com/go-gitea/gitea/blob/master/public/js/index.js#L2711) and it seems that the `#repolink` element in my HTML does have the `/scm` suffix. I'm not sure what the correct way is here, either have a different `#repolink` (which might break other stuff) or have the call relativize the URL correctly taking `ROOT_URL` into account
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2564