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

ROUT: update jsonp-p to use fetch #7387

Open
anselmbradford opened this issue Dec 2, 2022 · 1 comment
Open

ROUT: update jsonp-p to use fetch #7387

anselmbradford opened this issue Dec 2, 2022 · 1 comment

Comments

@anselmbradford
Copy link
Member

https://github.com/cfpb/consumerfinance.gov/blob/main/cfgov/unprocessed/apps/rural-or-underserved-tool/js/call-census.js#L1 and https://github.com/cfpb/consumerfinance.gov/blob/main/cfgov/unprocessed/apps/rural-or-underserved-tool/js/call-tiger.js#L1 uses a 6 year old package jsonp-p https://www.npmjs.com/package/jsonp-p

I would imagine this could be updated to use a native fetch call and the dependency could be tossed.

@anselmbradford
Copy link
Member Author

Investigated this and there is a problem. The census API we're using to geocode does not support CORS, which changing this to a fetch call requires.

https://stackoverflow.com/questions/51017702/enable-cors-in-fetch-api has some good background on CORS in fetch in general, and https://medium.com/@wherewhat/using-census-bureau-apis-client-side-in-javascript-ce6c1847c533 shows hitting the census API via a proxy.

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

1 participant