Skip to content
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

Updating s3 xml response message parsing #462

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/services/urlsigner.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export default {
request.open('POST', response.postEndpoint);
request.onload = function () {
if (request.status == 201) {
var s3Error = (new window.DOMParser()).parseFromString(request.response, "text/xml");
var successMsg = s3Error.firstChild.children[0].innerHTML;
var s3Success = (new window.DOMParser()).parseFromString(request.response, "text/xml");
var successMsg = s3Success.getElementsByTagName('PostResponse')[0].getElementsByTagName('Location')[0].innerHTML;
resolve({
'success': true,
'message': successMsg
Expand All @@ -76,7 +76,7 @@ export default {
};
request.onerror = function (err) {
var s3Error = (new window.DOMParser()).parseFromString(request.response, "text/xml");
var errMsg = s3Error.firstChild.children[1].innerHTML;
var errMsg = s3Error.getElementsByTagName('Error')[0].getElementsByTagName('Message')[0].innerHTML;
reject({
'success': false,
'message': errMsg
Expand Down