Skip to content

Commit

Permalink
fix: get tencent api query
Browse files Browse the repository at this point in the history
  • Loading branch information
yugasun committed Feb 9, 2020
1 parent 222bc32 commit 6e740ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions __tests__/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('getPathWithQueryStringParams: no params', () => {
test('getPathWithQueryStringParams: 1 param', () => {
const event = {
path: '/foo/bar',
queryStringParameters: {
queryString: {
'bizz': 'bazz'
}
}
Expand All @@ -26,7 +26,7 @@ test('getPathWithQueryStringParams: 1 param', () => {
test('getPathWithQueryStringParams: to be url-encoded param', () => {
const event = {
path: '/foo/bar',
queryStringParameters: {
queryString: {
'redirect_uri': 'http://lvh.me:3000/cb'
}
}
Expand All @@ -37,7 +37,7 @@ test('getPathWithQueryStringParams: to be url-encoded param', () => {
test('getPathWithQueryStringParams: 2 params', () => {
const event = {
path: '/foo/bar',
queryStringParameters: {
queryString: {
'bizz': 'bazz',
'buzz': 'bozz'
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const url = require('url')
const isType = require('type-is')

function getPathWithQueryStringParams (event) {
return url.format({ pathname: event.path, query: event.queryStringParameters })
return url.format({ pathname: event.path, query: event.queryString })
}
function getEventBody (event) {
return Buffer.from(event.body, event.isBase64Encoded ? 'base64' : 'utf8')
Expand Down

0 comments on commit 6e740ab

Please sign in to comment.