Skip to content

Commit

Permalink
fix: WPT API change wrt auth
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszczerpak-cloudinary committed Mar 26, 2024
1 parent 3ffe66b commit 15a7d2e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions wtp/apiCaller.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const runWtpTest = async (url, mobile, cb) => {
url: RUN_TEST_URL,
searchParams: {
url: url,
k: apiKey,
f: "json",
width: config.get('wtp.viewportWidth'),
height: config.get('wtp.viewportHeight'),
Expand All @@ -77,7 +76,7 @@ const runWtpTest = async (url, mobile, cb) => {
fvonly: 1, // first view only
timeline: 1 // workaround for WPT sometimes hanging on getComputedStyle()
},
headers: { 'User-Agent': 'WebSpeedTest' },
headers: { 'User-Agent': 'WebSpeedTest', 'X-WPT-API-KEY': apiKey },
throwHttpErrors: false
};
let response;
Expand Down Expand Up @@ -116,7 +115,7 @@ const checkTestStatus = async (testId, quality, cb) => {
let options = {
method: "GET",
url: GET_TEST_STATUS,
searchParams: {test: testId, k: config.get('wtp.apiKey'), f: "json"},
searchParams: {test: testId, f: "json"},
'headers': { 'User-Agent': 'WebSpeedTest' }
};
let response;
Expand Down

0 comments on commit 15a7d2e

Please sign in to comment.