Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "edgegrid", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Authorisation process and API helper for Akamai OPEN APIs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -113,4 +113,18 @@ // Node modules | ||
// headers are case-insensitive so this function returns the value of a header | ||
// no matter what its case is. Returns undefined if there's no header defined. | ||
request.getHeader = function(header) { | ||
var result = undefined; | ||
for (k in this.headers) { | ||
if (k.toLowerCase() === header) { | ||
result = this.headers[k]; | ||
break; | ||
} | ||
} | ||
return result; | ||
} | ||
if (request.method == "POST" || request.method == "PUT") { | ||
request.headers["content-type"] = 'application/x-www-form-urlencoded'; | ||
// Accept user-defined, case-insensitive content-type header -- or use default type | ||
request.headers['content-type'] = request.getHeader('content-type') || 'application/x-www-form-urlencoded'; | ||
request.headers['content-length'] = request.body.length; | ||
@@ -117,0 +131,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43765
665