Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some API calls do not respect root path #870

Closed
ChaosExAnima opened this issue Mar 27, 2024 · 6 comments · Fixed by #872
Closed

Some API calls do not respect root path #870

ChaosExAnima opened this issue Mar 27, 2024 · 6 comments · Fixed by #872
Assignees
Labels
type:bug Something isn't working
Milestone

Comments

@ChaosExAnima
Copy link

Data

  • Shiori version: 1.6.0
  • Database Engine: MySQL
  • Operating system: Docker
  • CLI/Web interface/Web Extension: Web interface

Describe the bug / actual behavior

Some API calls in the settings section of the front end don't use the base path. This includes:

Expected behavior

I expect my settings to save!

To Reproduce

Steps to reproduce the behavior:

  1. Set up an installation on a root path, ex: /shiori.
  2. Log in an admin account and navigate to settings.
  3. Click on 'Show bookmark's ID'
  4. See error

Screenshots

The error message is the HTML of another service I run, so I'd prefer to keep that private.

Notes

I dug around in the code a bit, and the linked lines I believe are the culprit. It looks like there's some inconsistency with API fetches, specifically the initial / for settings and lack of URL entirely for deleting accounts.

I can whip up a PR if needed.

@ChaosExAnima ChaosExAnima added the type:bug Something isn't working label Mar 27, 2024
@github-project-automation github-project-automation bot moved this to To do in Roadmap Mar 27, 2024
@fmartingr fmartingr added this to the 1.6.1 milestone Mar 27, 2024
@fmartingr
Copy link
Member

fmartingr commented Mar 27, 2024

Hey @ChaosExAnima, apologies for this. Let's figure out what's going on.

  • Have you set the --webroot flag to /shiori? (Assuming yes, but wanted to confirm)
  • Can you check if you have a <base href> and that the href attribute is correct with your webroot under Shiori's page source?

Note: Cann this be another side effect of #865?

@ChaosExAnima
Copy link
Author

ChaosExAnima commented Mar 27, 2024

Hi @fmartingr, yes and yes respectively. To be clear, if those aren't set the app doesn't load correctly- my app is loading and saving bookmarks no problem, but only certain API calls fail as per the title. If you double-check my description, I already linked to what I believe is the problem.

Also as a side note, it's incredibly confusing to have both the SHIORI_HTTP_ROOT_PATH env var and a --webroot argument.

@fmartingr
Copy link
Member

Hi @fmartingr, yes and yes respectively. To be clear, if those aren't set the app doesn't load correctly- my app is loading and saving bookmarks no problem, but only certain API calls fail as per the title. If you double-check my description, I already linked to what I believe is the problem.

I just wanted to confirm the problem which seems to be the slash at the beginning of those calls ignoring the root path in the base element.

Also as a side note, it's incredibly confusing to have both the SHIORI_HTTP_ROOT_PATH env var and a --webroot argument.

Yeah, this is a bug, only one should be required, potentially to be fixed in 1.6.1 this week once I merge #865

@fmartingr
Copy link
Member

Can you check if this was solved with v1.6.1?

@ChaosExAnima
Copy link
Author

@fmartingr - not fixed, no.

@fmartingr
Copy link
Member

@fmartingr - not fixed, no.

Ups, sorry, I thought this was another ticket! Let me do a quick PR for this.

@fmartingr fmartingr self-assigned this Mar 31, 2024
@fmartingr fmartingr removed this from the 1.6.1 milestone Mar 31, 2024
@fmartingr fmartingr moved this from To do to In progress in Roadmap Mar 31, 2024
@fmartingr fmartingr added this to the 1.6.2 milestone Mar 31, 2024
fmartingr added a commit that referenced this issue Mar 31, 2024
fmartingr added a commit that referenced this issue Apr 7, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Roadmap Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants