Repository navigation
Conversation
Add tests modeled on how popular downstream packages subclass StaticFileHandler, so that changes to the base class that would break them are caught here: - A multi-root handler (as in jupyter_server) installed as the static_handler_class with a list static_path, used through static_url; and make_static_url called directly with static_path=None by a handler that finds its own files (voila). - A handler that routes by path prefix to one of several roots and calls super().get_absolute_path with that root (Bokeh). A ../ from one of its roots into another is rejected by the base get_absolute_path, even though the subclass's own validation would accept it. - A handler that sets allowed_symlink_directory itself during validate_absolute_path, following symlinked directories (Jupyter's actual FileFindHandler). - A get_absolute_path instance method that reassigns self.root, which get() must then pass to validate_absolute_path (voila). - A handler whose path is a single file, possibly a symlink (JupyterHub's LogoHandler). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019nvEV873ZwBncgxPP13Xfd
This branch has not been deployed
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 tests modeled on how popular downstream packages subclass StaticFileHandler, so that changes to the base class that would break them are caught here:
Claude-Session: https://claude.ai/code/session_019nvEV873ZwBncgxPP13Xfd