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

Commits on Nov 15, 2024

  1. Strip origin when obtaining url in urlFor()

    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 <[email protected]>
    rak-phillip committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    7173499 View commit details
    Browse the repository at this point in the history
  2. Create a canParse() utility function for URLs

    `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 <[email protected]>
    rak-phillip committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    1693709 View commit details
    Browse the repository at this point in the history
  3. Create unit tests for stripOrigin()

    Signed-off-by: Phillip Rak <[email protected]>
    rak-phillip committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    3fb53be View commit details
    Browse the repository at this point in the history