feat: external redirection#68
Open
jahn-junior wants to merge 2 commits into
Open
Conversation
tests: add basic test for external redirects
jahn-junior
commented
Mar 13, 2026
Comment on lines
+142
to
+144
| def is_external(dest: str) -> bool: | ||
| """Return True if the redirect destination is a URL.""" | ||
| return dest.startswith(('http://', 'https://')) |
Author
There was a problem hiding this comment.
This is a bit shaky. Open to alternatives.
jahn-junior
commented
Mar 13, 2026
Author
There was a problem hiding this comment.
ensure_redirect wasn't built with external redirects in mind, so I figured it was better to stray from the pattern than to rewrite it for this one test.
Author
|
@AA-Turner @TheTripleV Hello! I'm hoping to get some more opinions on this and #67. These two PRs unblock my team's adoption of the extension. Thanks for your time! (Sorry if you aren't the right people to ping. I made a guess based on the commit history.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for external redirects. Resolves #41.
The implementation involves a
build_internal_redirecthelper function that gets called in the mainbuild_redirectsloop if the destination string starts withhttp://orhttps://Open to any feedback on the overall design and implementation. Thanks in advance for your time!