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
CONSOLE-3591: Remove directory listing for /static/* #13001
Conversation
@jhadvig: This pull request references CONSOLE-3591 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@jhadvig: This pull request references CONSOLE-3591 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@jhadvig: This pull request references CONSOLE-3591 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
// If the request is for a directory, return a 404. | ||
// Directory path is expected to end with a slash or be empty, | ||
// since we are stripping the '/static/' prefix from the path. | ||
if strings.HasSuffix(r.URL.Path, "/") || r.URL.Path == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work if we try to visit /static/assets
(no trailing slash)? Seems like this would cause the path to be assets
, which wouldn't meet either of these conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be working since the /static/assets
is redirected to /static/assets/
. Will test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TheRealJon confirming that user will get redirected to /static/assets/
and 404 is shown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhadvig, TheRealJon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
QE Approver:
|
/label px-approved |
/label docs-approved |
Launched a cluster against the pr, visit /static and /static/assets: /label qe-approved |
@jhadvig: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Removing listing for both all the directories, mainly:
/static/
/static/assets/
Instead console server will return 404
Screen:
/assign @TheRealJon
@spadgett FYI