wcs: return empty/error response for requests made to nonexistent sites (#39972)
This commit is contained in:
parent
fa17bffadf
commit
9c841ea861
|
@ -26,7 +26,12 @@ def get_wcs_services():
|
|||
return {}
|
||||
return settings.KNOWN_SERVICES.get('wcs')
|
||||
|
||||
|
||||
def get_wcs_json(wcs_site, path):
|
||||
if wcs_site is None:
|
||||
# no site specified (probably an import referencing a not yet deployed
|
||||
# site)
|
||||
return {'err': 1, 'err_desc': 'no-wcs-site'}
|
||||
response = requests.get(path, remote_service=wcs_site, without_user=True,
|
||||
headers={'accept': 'application/json'})
|
||||
if response.status_code != 200:
|
||||
|
|
Loading…
Reference in New Issue