-
Notifications
You must be signed in to change notification settings - Fork 278
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
Can't support AWS China Region url. #77
Comments
fix it:
** fix this else if (AWS.config.region === "cn-north-1") {
|
I noticed the same issue with the af-south-1 region. This fix seems to work. I'll copy the change above, since the formatting is broken. function object2hrefvirt(bucket, key) {
var enckey = key.split('/').map(function(x) { return encodeURIComponent(x); }).join('/');
if (AWS.config.region === "us-east-1") {
return document.location.protocol + '//' + bucket + '.s3.amazonaws.com/' + enckey;
} else {
return document.location.protocol + '//' + bucket + '.s3.' + AWS.config.region + '.amazonaws.com/' + enckey;
}
}
function object2hrefpath(bucket, key) {
var enckey = key.split('/').map(function(x) { return encodeURIComponent(x); }).join('/');
if (AWS.config.region === "us-east-1") {
return document.location.protocol + "//s3.amazonaws.com/" + bucket + "/" + enckey;
} else {
return document.location.protocol + "//s3.' + AWS.config.region + '.amazonaws.com/" + bucket + "/" + enckey;
}
} I would submit a PR, but I spotted this: Lines 688 to 690 in 4de1fd0
and I don't know enough about AWS URLs to be sure of all the possibilities. (The URLs don't seem to be consistent between regions, e.g. https://gbif-open-data-eu-central-1.s3-eu-central-1.amazonaws.com/occurrence/2021-04-13/citation.txt and https://gbif-open-data-eu-central-1.s3.eu-central-1.amazonaws.com/occurrence/2021-04-13/citation.txt both work, with either |
When click the object in the explorer list, the open window was blank with wrong url format, like "bucketname.s3-cn-north-1.amazonaws.com/object". Maybe cause by AWS china region url format is different with global region. The object correct url format is "bucketname.s3.cn-north-1.amazonaws.com.cn/object".
Please fix it, Thanks.
The text was updated successfully, but these errors were encountered: