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

Chore/url for origin #12621

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rak-phillip
Copy link
Member

Summary

Fixes #

Occurred changes and/or fixed issues

Technical notes summary

Areas or cases that should be tested

Areas which could experience regressions

Screenshot/Video

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

There are instances where Steve can provide the url of the API server for content links (e.g. `http://127.0.0.1:9443/v1/management.cattle.io.clusters`); this can prove to be problematic if the URL for Steve and the frontend server differ, resulting in CORS errors when Dashboard attempts to communicate with Steve directly. By stripping the origin from the URL, we can ensure that uses the correct base url and always routes API traffic through a proxy.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
`URL.canParse()` is newly available as of December 2023 and might not work in older devices or browsers. We can use this utility function until we target a version of ecmascript/node that will reliably support `URL.canParse()` across all browsers and devices.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant