Skip to content

Commit

Permalink
fix Qiniu auth headers
Browse files Browse the repository at this point in the history
  • Loading branch information
lihsai0 committed Mar 16, 2022
1 parent 989b273 commit b8343f8
Show file tree
Hide file tree
Showing 5 changed files with 397 additions and 45 deletions.
5 changes: 4 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ export declare namespace util {

function hmacSha1(encodedFlags: string | Buffer, secretKey: string | Buffer): string;

function canonicalMimeHeaderKey(fieldName: string): string;

/**
* 创建AccessToken凭证
* @param mac AK&SK对象
Expand All @@ -380,8 +382,9 @@ export declare namespace util {
* @param reqMethod 请求方法,例如 GET,POST
* @param reqContentType 请求类型,例如 application/json 或者 application/x-www-form-urlencoded
* @param reqBody 请求Body,仅当请求的 ContentType 为 application/json 或者 application/x-www-form-urlencoded 时才需要传入该参数
* @param reqHeaders 请求Headers,例如 {"X-Qiniu-Name": "Qiniu", "Content-Type": "application/x-www-form-urlencoded"}
*/
function generateAccessTokenV2(mac: auth.digest.Mac, requestURI: string, reqMethod: string, reqContentType: string, reqBody?: string): string;
function generateAccessTokenV2(mac: auth.digest.Mac, requestURI: string, reqMethod: string, reqContentType: string, reqBody?: string, reqHeaders?: Record<string, string>): string;

/**
* 校验七牛上传回调的Authorization
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qiniu",
"version": "7.4.0",
"version": "7.5.0",
"description": "Node wrapper for Qiniu Resource (Cloud) Storage API",
"main": "index.js",
"directories": {
Expand Down Expand Up @@ -45,9 +45,9 @@
"email": "jinxinxin@qiniu.com"
}
],
"engines": [
"node >= 6"
],
"engines": {
"node": ">= 6"
},
"dependencies": {
"agentkeepalive": "^4.0.2",
"before": "^0.0.1",
Expand Down
Loading

0 comments on commit b8343f8

Please sign in to comment.