Skip to content

Commit 8e751f8

Browse files
Merge pull request #188 from particle-iot/feature/sc-131002/remove-query-access-token-from-particle-api
feat: [sc-131002] Remove query access_token from particle-api-js
2 parents 13701e3 + 6fdd933 commit 8e751f8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/EventStream.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ class EventStream extends EventEmitter {
2929
const req = requestor.request({
3030
hostname,
3131
protocol,
32-
path: `${path}?access_token=${this.token}`,
32+
path,
33+
headers: {
34+
'Authorization': `Bearer ${this.token}`
35+
},
3336
method: 'get',
3437
// @ts-ignore
3538
port: parseInt(port, 10) || (isSecure ? 443 : 80),

test/EventStream.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ describe('EventStream', () => {
4949
expect(http.request).to.have.been.calledWith({
5050
hostname: 'hostname',
5151
protocol: 'http:',
52-
path: '/path?access_token=token',
52+
path: '/path',
53+
headers: {
54+
'Authorization': 'Bearer token'
55+
},
5356
method: 'get',
5457
port: 8080,
5558
mode: 'prefer-streaming'

0 commit comments

Comments
 (0)