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

fix(mobile): set custom headers on external url (#14707) #14708

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

alex-sherwin
Copy link
Contributor

@alex-sherwin alex-sherwin commented Dec 15, 2024

This change fixes it so that when entering an External Network endpoint for Automatic URL switching that it uses all the headers from ApiService.getRequestHeaders() instead of hard-coding only x-immich-user-token

This way the server test will include both x-immich-user-token AND any custom proxy headers that are configured, since ApiService.getRequestHeaders() returns a map containing all of these.

This is necessary if the external network endpoint you are trying to configure requires these custom proxy headers (such as if you are using Cloudflare with Service Auth headers)

Without this fix, it's impossible to configure such a server as an external endpoint since the call to $url/users/me will fail (due to missing custom headers) and the endpoint won't be added.

Close #14707

when setting up a external server for automatic URL switching ensure all access token AND custom headers are used for the server validaton request
@alextran1502
Copy link
Contributor

Thank you

@alextran1502 alextran1502 enabled auto-merge (squash) December 15, 2024 21:05
@alextran1502 alextran1502 merged commit fe554c3 into immich-app:main Dec 15, 2024
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic URL switching doesn't work with custom proxy headers
2 participants