Skip to content

Commit abce572

Browse files
committed
per Strava, subscriptions are moving from "api." to "www.".
1 parent 3e08cf8 commit abce572

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

lib/pushSubscriptions.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
var authenticator = require('./authenticator')
22

3+
// Ref: https://developers.strava.com/docs/webhooks/
4+
35
var pushSubscriptions = function (client) {
46
this.client = client
5-
6-
// Per Strava, this part of the API uses use the "api." subdomain,
7-
// not "www." like most of the API.
8-
// Ref: https://strava.github.io/api/v3/events/
9-
this.baseUrl = 'https://api.strava.com/api/v3/'
107
}
118

129
var _allowedPostProps = [

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "strava-v3",
3-
"version": "2.0.2",
4-
"description": "Simple wrapper for strava v3 api",
3+
"version": "2.0.3",
4+
"description": "Simple wrapper for strava v3 API",
55
"main": "index.js",
66
"scripts": {
77
"test": "npx eslint *.js lib test && npx mocha test/*.js",

test/pushSubscriptions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var strava = require('../')
77
describe('pushSubscriptions_test', function () {
88
describe('#list()', function () {
99
before(() => {
10-
nock('https://api.strava.com')
10+
nock('https://www.strava.com')
1111
.filteringPath(() => '/api/v3/push_subscriptions/')
1212
.get(/^\/api\/v3\/push_subscriptions/)
1313
// The first reply just echo's the request headers so we can test them.
@@ -53,7 +53,7 @@ describe('pushSubscriptions_test', function () {
5353

5454
describe('#create({callback_url:...})', function () {
5555
before(() => {
56-
nock('https://api.strava.com')
56+
nock('https://www.strava.com')
5757
.filteringPath(() => '/api/v3/push_subscriptions')
5858
// The first reply just echo's the request headers so we can test them.
5959
.post(/^\/api\/v3\/push_subscriptions/)
@@ -106,7 +106,7 @@ describe('pushSubscriptions_test', function () {
106106
before(() => {
107107
// The status is not normally returned in the body.
108108
// We return it here because the test can't easily access the HTTP status code.
109-
nock('https://api.strava.com')
109+
nock('https://www.strava.com')
110110
.filteringPath(() => '/api/v3/push_subscriptions/1/')
111111
// The first reply just echo's the request headers so we can test them.
112112
.delete(/^\/api\/v3\/push_subscriptions\/1/)

0 commit comments

Comments
 (0)