codeforboston / codeforboston/migrant_service_map

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

Open
#276 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
26
Forks
57
PR merge metrics
No merged PRs in 30d

Description

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](https://docs.google.com/spreadsheets/d/e/2PACX-1vT4MST1klxwmBdfvMhOycfV5C-lxGe0_sidJnmGS8U42irBYhgazisd-OUjrI4V9l_GqnazklGhNjzJ/pub?output=csv) 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...

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named. Start by locating the site's Google Sheets publish request and confirming the direct CSV behavior described in the issue. Done means selecting and implementing one supported way to load the spreadsheet data, then verifying that the page loads without the broken CORS redirect.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.