Skip to content

Commit 6e740ab

Browse files
committed
fix: get tencent api query
1 parent 222bc32 commit 6e740ab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

__tests__/unit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test('getPathWithQueryStringParams: no params', () => {
1515
test('getPathWithQueryStringParams: 1 param', () => {
1616
const event = {
1717
path: '/foo/bar',
18-
queryStringParameters: {
18+
queryString: {
1919
'bizz': 'bazz'
2020
}
2121
}
@@ -26,7 +26,7 @@ test('getPathWithQueryStringParams: 1 param', () => {
2626
test('getPathWithQueryStringParams: to be url-encoded param', () => {
2727
const event = {
2828
path: '/foo/bar',
29-
queryStringParameters: {
29+
queryString: {
3030
'redirect_uri': 'http://lvh.me:3000/cb'
3131
}
3232
}
@@ -37,7 +37,7 @@ test('getPathWithQueryStringParams: to be url-encoded param', () => {
3737
test('getPathWithQueryStringParams: 2 params', () => {
3838
const event = {
3939
path: '/foo/bar',
40-
queryStringParameters: {
40+
queryString: {
4141
'bizz': 'bazz',
4242
'buzz': 'bozz'
4343
}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const url = require('url')
1818
const isType = require('type-is')
1919

2020
function getPathWithQueryStringParams (event) {
21-
return url.format({ pathname: event.path, query: event.queryStringParameters })
21+
return url.format({ pathname: event.path, query: event.queryString })
2222
}
2323
function getEventBody (event) {
2424
return Buffer.from(event.body, event.isBase64Encoded ? 'base64' : 'utf8')

0 commit comments

Comments
 (0)