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

Google Sheets publish link no longer works due to redirect with broken CORS #276

Open
alexjball opened this issue Jun 25, 2020 · 2 comments

Comments

@alexjball
Copy link
Member

alexjball commented Jun 25, 2020

The request to sheets redirects with a 307 to what looks like a cache server. That server responds with the spreadsheet content but does not set the access-control-allow-origin header, which fails the request due to CORS. This is a server side issue that we can't fix on the client. Downloading directly still works

Immediate-term we can include the csv in the site so the page loads, but we won't pull in new providers.

Long term options:

  1. We can use the Google Drive API to download the sheet. This may require authenticating as a user which would complicate things: https://developers.google.com/drive/api/v3/manage-downloads#download_a_google_document
  2. Use a server to periodically download the CSV and upload it to firebase cloud storage, where the client can access it. Servers can be configured to disregard CORS.
  3. Use a server to proxy sheets access. This could be more responsive to spreadsheet updates. I don't think it makes sense as a solution for MSM since the spreadsheet hasn't actually been touched since launch...
@alexjball
Copy link
Member Author

Immediate-term fix here: c7a47f9

@thadk
Copy link
Member

thadk commented Jul 6, 2020

This demo seems to still work: https://www.mapbox.com/impact-tools/sheet-mapper

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