DOI-USGS / asc-public-docs

Public facing documentation for ASC
Other
0 stars 7 forks source link

CORs errors for USWDS components #99

Closed amystamile-usgs closed 4 months ago

amystamile-usgs commented 5 months ago

Problem: USWDS svgs and fonts are blocked by CORS

Why: When trying to access files within a public S3 website, you run into CORs errors. The CHS solution to this is to place the S3 url in a Cloudfront and including the appropriate response headers to handle CORs. We have done this but unfortunately the cloudfront is only accessible under the VPN. This is due to our Cloudfront not being under a WAF. (I believe we are not longer allowed to set up our own WAF, therefore we have to do this through the eSAS team). Therefore the styling does not work off VPN.

Possible solutions: Places all USWDS css, js, and images within the repo to avoid having to access external urls. (I believe we originally placed all of uswds styling in the S3 to keep the docs repo clean.)

jrcain-usgs commented 4 months ago

Fixed by adding a CORS header to the S3 bucket containing the resources, which allows GET and HEAD requests from astrogeology.usgs.gov. Cannot place USWDS fonts and SVGs in repository, as they are not public domain.