Skip to content

Commit 15a7d2e

Browse files
fix: WPT API change wrt auth
1 parent 3ffe66b commit 15a7d2e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

wtp/apiCaller.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const runWtpTest = async (url, mobile, cb) => {
6767
url: RUN_TEST_URL,
6868
searchParams: {
6969
url: url,
70-
k: apiKey,
7170
f: "json",
7271
width: config.get('wtp.viewportWidth'),
7372
height: config.get('wtp.viewportHeight'),
@@ -77,7 +76,7 @@ const runWtpTest = async (url, mobile, cb) => {
7776
fvonly: 1, // first view only
7877
timeline: 1 // workaround for WPT sometimes hanging on getComputedStyle()
7978
},
80-
headers: { 'User-Agent': 'WebSpeedTest' },
79+
headers: { 'User-Agent': 'WebSpeedTest', 'X-WPT-API-KEY': apiKey },
8180
throwHttpErrors: false
8281
};
8382
let response;
@@ -116,7 +115,7 @@ const checkTestStatus = async (testId, quality, cb) => {
116115
let options = {
117116
method: "GET",
118117
url: GET_TEST_STATUS,
119-
searchParams: {test: testId, k: config.get('wtp.apiKey'), f: "json"},
118+
searchParams: {test: testId, f: "json"},
120119
'headers': { 'User-Agent': 'WebSpeedTest' }
121120
};
122121
let response;

0 commit comments

Comments
 (0)