Skip to content

Instantly share code, notes, and snippets.

@floydnoel
Last active April 30, 2018 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floydnoel/122618b864babf29ffb014359498b93c to your computer and use it in GitHub Desktop.
Save floydnoel/122618b864babf29ffb014359498b93c to your computer and use it in GitHub Desktop.
CORS problem? forget about it!
// takes a string URL, and returns a string URL which allows the request to proceed without CORS blocking
const forgetAboutCors = u => `https://cors-anywhere.herokuapp.com/${u}`
// example usage: forgetAboutCors(`https://clinicaltrials.gov/ct2/show/${'NCT03512561'}?displayxml=true`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment