Skip to content

Detect fetching folders/trees to avoid unnecessary auth #122

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

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Conversation

kzu
Copy link
Member

@kzu kzu commented Oct 18, 2024

The authentication step is only needed when actually fetching raw github resources that potentially exist. But raw URLs pointing to /tree/ will always fail by definition (can't get the raw content of a folder).

Since the raw handler overwrites the request URI, we preserve the original URI as the Referrer, so it can be checked by other handlers.

@kzu kzu added the enhancement New feature or request label Oct 18, 2024
@kzu kzu enabled auto-merge (rebase) October 18, 2024 17:11
The authentication step is only needed when actually fetching raw github resources that potentially exist. But raw URLs pointing to `/tree/` will always fail by definition (can't get the raw content of a folder).

Since the raw handler overwrites the request URI, we preserve the original URI as the Referrer, so it can be checked by other handlers.
@kzu kzu merged commit 91f1587 into main Oct 18, 2024
7 checks passed
@kzu kzu deleted the dev/tree-auth branch October 18, 2024 17:13
@devlooped devlooped locked and limited conversation to collaborators Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant