When trying to preview a JSON file stored on S3 with the help of ckanext-cloudstorage, it fails with the following error message for the Text preview tab:
SignatureDoesNotMatch
The request signature we calculated does not match the signature you provided. Check your key and signing method.
application/json
1533315469
The reason is, that the JavaScript on the Text preview page makes a request with the Content-Type header set to application/json, when the format of the resource is either JSON or GeoJSON.
This leads to signature mismatch, because ckanext-cloudstorage doesn't include that header when generating the signature, but the request happens with the Content-Type header.
The GeoJSON or Map viewer preview tabs work fine (if enabled).
ckanext-cloudstorage should take the Content-Type header into account when generating the signature (possibly other headers as well, but I have only encountered a problem with the Text preview and the Content-Type header).
When trying to preview a JSON file stored on S3 with the help of
ckanext-cloudstorage
, it fails with the following error message for the Text preview tab:The reason is, that the JavaScript on the Text preview page makes a request with the
Content-Type
header set toapplication/json
, when the format of the resource is eitherJSON
orGeoJSON
. This leads to signature mismatch, becauseckanext-cloudstorage
doesn't include that header when generating the signature, but the request happens with theContent-Type
header.The GeoJSON or Map viewer preview tabs work fine (if enabled).
ckanext-cloudstorage
should take theContent-Type
header into account when generating the signature (possibly other headers as well, but I have only encountered a problem with the Text preview and theContent-Type
header).