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

Unable to download catalog item #1843

Open
akshansh-modi opened this issue Aug 2, 2024 · 6 comments
Open

Unable to download catalog item #1843

akshansh-modi opened this issue Aug 2, 2024 · 6 comments
Labels
issue/stale Issue has not had any activity for an extended period of time kind/bug Something isn't working

Comments

@akshansh-modi
Copy link
Contributor

Description

i am unable to download catalog item , it seems to me that this is a CORS issue

Screenshots

image
image
image

Workaround : opening download link in another tab seems to work

Enviroment:

  • OS: Linux
  • Browser: Chrome
  • Version:
  • Device: Desktop

Contributor Guides and Handbook

The meshery.io website uses Jekyll and GitHub Pages. Site content is found under the master branch.

@akshansh-modi akshansh-modi added the kind/bug Something isn't working label Aug 2, 2024
@sudhanshutech
Copy link
Member

sudhanshutech commented Aug 8, 2024

@akshansh-modi are you willing to work on the issue?

@akshansh-modi
Copy link
Contributor Author

Yes, I was looking into it since I am also working on issue #1768. This appears to be an easy one-line fix. Could you please assign it to me so I can create the PR?

@akshansh-modi
Copy link
Contributor Author

@sudhanshutech, should I go ahead and create a PR?

@leecalcote
Copy link
Member

@sudhanshutech, should I go ahead and create a PR?

What' fix are you proposing?

@akshansh-modi
Copy link
Contributor Author

akshansh-modi commented Aug 10, 2024

@leecalcote @sudhanshutech
The current implementation uses fetch for downloading a resource, which triggers CORS issues.

Proposed Solution:
To bypass the CORS issue, I suggest using an <a> tag for direct navigation to the download link.
This change will allow the resource to be downloaded without encountering CORS errors as the browser will treat it as only navigation.

  • Update the link from:
    <a href="/catalog/{{type.downloadLink}}" download>
    
    to:
    <a href="https://playground.meshery.io/api/pattern/download/{{type.patternId}}" download>
    

Copy link

stale bot commented Sep 15, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the issue/stale Issue has not had any activity for an extended period of time label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/stale Issue has not had any activity for an extended period of time kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants