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

CONSOLE-3591: Remove directory listing for /static/* #13001

Merged
merged 1 commit into from Jul 21, 2023

Conversation

jhadvig
Copy link
Member

@jhadvig jhadvig commented Jul 12, 2023

Removing listing for both all the directories, mainly:

  • /static/
  • /static/assets/

Instead console server will return 404

Screen:
Screenshot 2023-07-12 at 17 48 13

/assign @TheRealJon

@spadgett FYI

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 12, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jul 12, 2023

@jhadvig: This pull request references CONSOLE-3591 which is a valid jira issue.

In response to this:

Removing listing for both all the directories, mainly:

  • /static/
  • /static/assets/

/assign @TheRealJon

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.

@openshift-ci openshift-ci bot requested review from florkbr and rhamilto July 12, 2023 11:27
@openshift-ci openshift-ci bot added component/backend Related to backend approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 12, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jul 12, 2023

@jhadvig: This pull request references CONSOLE-3591 which is a valid jira issue.

In response to this:

Removing listing for both all the directories, mainly:

  • /static/
  • /static/assets/

Instead console server will return 404

/assign @TheRealJon

@spadgett FYI

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jul 12, 2023

@jhadvig: This pull request references CONSOLE-3591 which is a valid jira issue.

In response to this:

Removing listing for both all the directories, mainly:

  • /static/
  • /static/assets/

Instead console server will return 404

Screen:
Screenshot 2023-07-12 at 17 48 13

/assign @TheRealJon

@spadgett FYI

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 == "" {
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 18, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 18, 2023

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jhadvig
Copy link
Member Author

jhadvig commented Jul 18, 2023

QE Approver:

/assign @yanpzhan
Docs Approver:

/assign @ahardin-rh
PX Approver:
/assign @RickJWagner

@RickJWagner
Copy link

/label px-approved

@openshift-ci openshift-ci bot added the px-approved Signifies that Product Support has signed off on this PR label Jul 18, 2023
@RickJWagner RickJWagner removed their assignment Jul 18, 2023
@opayne1
Copy link
Contributor

opayne1 commented Jul 19, 2023

/label docs-approved

@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label Jul 19, 2023
@yanpzhan
Copy link
Contributor

Launched a cluster against the pr, visit /static and /static/assets:
https://console-openshift-console.apps.ci-ln-y7ymwpt-76ef8.aws-2.ci.openshift.org/static
https://console-openshift-console.apps.ci-ln-y7ymwpt-76ef8.aws-2.ci.openshift.org/static/assets/
both show "404 page not found"

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Jul 20, 2023
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 91a0953 and 2 for PR HEAD cbfa527 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 21, 2023

@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.

@openshift-merge-robot openshift-merge-robot merged commit 0d2f847 into openshift:master Jul 21, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/backend Related to backend docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants