erddap icon indicating copy to clipboard operation
erddap copied to clipboard

Search Multiple ERDDAPs seems to be broken

Open BobSimons opened this issue 1 year ago • 1 comments

The Search Multiple ERDDAPs web page, e.g., https://coastwatch.pfeg.noaa.gov/erddap/download/SearchMultipleERDDAPs.html, appears to be broken. The problem occurs with any search terms that I try, e.g., temperature It should return the results of a search sent to many ERDDAPs. Instead, it just works with a few remote ERDDAPs, but the Javascript that powers the page mostly throws an error that you can see in your browser's console

"Refused to load the script '<URL>' because it violates the following Content Security Policy directive: "script-src 'self' <URL> <URL> <URL> <URL> <URL> <URL> <URL> <URL> <URL> <URL> 'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

coastwatch.noaa.gov//erddap/search/index.json?page=1&itemsPerPage=100000&searchFor=EDDGridFromErddap&.jsonp=convertJsonToTable:1 "

Thus, this seems to be a HTML issue related to security and may have a simple solution. Sorry, I didn't try to figure it out or find the solution. I'm testing with Chrome on a Chromebook.

BobSimons avatar Aug 20 '23 19:08 BobSimons

The content security policy (CSP) is controlled by the server admin, not the ERDDAP code. The easiest fix would be to add all of the possible ERDDAP servers to the CSP. There may be a way to re-write the search to work without that long list in the CSP, but I'll need to look more into that.

ChrisJohnNOAA avatar Aug 21 '23 17:08 ChrisJohnNOAA

This was resolved when the CSP for the server was updated.

ChrisJohnNOAA avatar Jun 26 '24 14:06 ChrisJohnNOAA