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

Should not place unusable responses from providers into metadata cache #630

Open
jimmylewis opened this issue May 3, 2021 · 1 comment

Comments

@jimmylewis
Copy link
Contributor

Describe the bug

See this detailed writeup

To Reproduce

Steps to reproduce the behavior:

  1. Download a library but get an invalid (unparseable) JSON response from the provider
  2. Try again, expecting the retry to return a valid JSON payload

Operation fails again, because the bad response is placed in the cache, so we keep reusing it.

Expected behavior

Should issue the request to the provider again, and get a fresh (hopefully functional) response.

@EdiWang
Copy link

EdiWang commented May 3, 2021

Just retry the request may not be enough to fix the issue. I tested a few times and found the provider's CDN will return the same broken JSON for a same IP and user agent. To force the provider to return a fresh response, libman may need to have a method to make CDN think it is not the same client.

Libman can't change client IP, so there may be two options to force CDN to refresh

  • Append a random number to the query string like: https://api.cdnjs.com/libraries/tinymce?996
  • Add a random user agent string to the request header

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

No branches or pull requests

2 participants