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

Protocol, Domain & port with request.get_url over just reporting the path #415

Closed
2 tasks done
Jorricks opened this issue Jan 19, 2023 · 5 comments
Closed
2 tasks done

Comments

@Jorricks
Copy link

Checklist

  • The bug is reproducible against the latest release or master.
  • There are no similar issues or pull requests to fix it yet.

Describe the bug

When using SQLAdmin behind a proxy, the URLs use 'http://' instead of 'https://'
This can be fixed by setting the Uvicorn proxy settings.
However, using full URLs will lead to many unnecessary issues. Using just paths as mentioned here will work fine in all cases; encode/starlette#538 (comment)

Steps to reproduce the bug

Run SQLAdmin behind a proxy.

Expected behavior

All URLs should just be the subpath.

Actual behavior

All URLs contain the protocol, domain (optinally port as well) and finally the path.

Debugging material

No response

Environment

Python 3.8
SQLAdmin 0.8.0

Additional context

No response

@Jorricks
Copy link
Author

Jorricks commented Jan 19, 2023

I experimented with multiple docker-compose setups and the annoying part of this setup is that this will only appear once you move onto a non-local setup where you have HTTPS.
Very interested to hear your opinion @aminalaee.

I don't mind working on the PR myself :)

Updated:
Seems the community is a bit divided on how this should work; encode/starlette#1855 (comment)
I think in SQLAdmins case, relative is fine.

@aminalaee
Copy link
Owner

aminalaee commented Jan 19, 2023

Hey, thanks for reporting this and offering to help with it.

If I remember correctly it was initially using relative path, then because of the issue that relative path was ignoring the root_path we had to switch to using full URLs:
#369
and see the MR(s) related to that.

Can you please explain what you mean by unnecessary changes? Like Uvicorn config?

@aminalaee
Copy link
Owner

@Jorricks Any updates with this?

@Jorricks
Copy link
Author

Jorricks commented Mar 8, 2023

I don't recall the specifics but I made it work somehow 🤔😅. It might have been some issues with an other app and not with SQLAdmin. Let's close it :)

@Jorricks Jorricks closed this as completed Mar 8, 2023
@Jorricks Jorricks reopened this Mar 8, 2023
@Jorricks Jorricks closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2023
@aminalaee
Copy link
Owner

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants