Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aliyun-UED/aliyun-sdk-js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: gokuai/aliyun-sdk-js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on May 6, 2015

  1. 不解析xml

    GeorgeXu committed May 6, 2015
    Copy the full SHA
    7e302cc View commit details

Commits on May 7, 2015

  1. 兼容header小心

    GeorgeXu committed May 7, 2015
    Copy the full SHA
    d99037c View commit details
  2. 修复问题

    GeorgeXu committed May 7, 2015
    Copy the full SHA
    3ca91ce View commit details
Showing with 17 additions and 12 deletions.
  1. +14 −9 lib/service_interface/rest_xml.js
  2. +3 −3 lib/signers/oss.js
23 changes: 14 additions & 9 deletions lib/service_interface/rest_xml.js
Original file line number Diff line number Diff line change
@@ -54,19 +54,24 @@ ALY.ServiceInterface.RestXml = {
} else {
resp.data[payload] = httpResponse.body.toString();
}

resp.data.RequestId = httpResponse.headers['x-oss-request-id'] ||
httpResponse.headers['x-oss-requestid'];

} else if (httpResponse.body.length > 0) {
try {
var parser = new ALY.XML.Parser(operation.output || {});
ALY.util.update(resp.data, parser.parse(httpResponse.body.toString()));
}
catch(err) {
// ignore parse error
}
resp.data = httpResponse.body.toString();
// try {
// var parser = new ALY.XML.Parser(operation.output || {});
// ALY.util.update(resp.data, parser.parse(httpResponse.body.toString()));
// }
// catch(err) {
// // ignore parse error
// }
}

// extract request id
resp.data.RequestId = httpResponse.headers['x-oss-request-id'] ||
httpResponse.headers['x-oss-requestid'];
// resp.data.RequestId = httpResponse.headers['x-oss-request-id'] ||
// httpResponse.headers['x-oss-requestid'];
},

populateBody: function populateBody(req) {
6 changes: 3 additions & 3 deletions lib/signers/oss.js
Original file line number Diff line number Diff line change
@@ -55,16 +55,16 @@ ALY.Signers.OSS = inherit(ALY.Signers.RequestSigner, {

var parts = [];
parts.push(r.method);
parts.push(r.headers['Content-MD5'] || '');
parts.push(r.headers['Content-Type'] || '');
parts.push(r.headers['Content-MD5'] || r.headers['content-md5'] || '');
parts.push(r.headers['Content-Type'] || r.headers['content-type'] || '');

// This is the "Date" header, but we use X-Amz-Date.
// The S3 signing mechanism requires us to pass an empty
// string for this Date header regardless.
// this works:
// getSignedUrl use 'presigned-expires'
// other request use 'Date'
parts.push(r.headers['presigned-expires'] || r.headers['Date'] || '');
parts.push(r.headers['presigned-expires'] || r.headers['Date'] || r.headers['date'] || '');

var headers = this.canonicalizedHeaders();
if (headers) parts.push(headers);