DEV: Log response headers when getting rate limit errors during smoke tests (#15487)
We've recently added diagnostic headers that Discourse includes in the response when it rate limits a request. This PR makes our smoke tests runner log the response headers it encounters a rate limit error so we can get a better visibility into what caused the rate limit.
This commit is contained in:
parent
6b6c0fef4c
commit
748e08830f
|
@ -76,6 +76,13 @@ const path = require("path");
|
|||
console.log(
|
||||
"FAILED HTTP REQUEST TO " + resp.url() + " Status is: " + resp.status()
|
||||
);
|
||||
if (resp.status() === 429) {
|
||||
const headers = resp.headers();
|
||||
console.log("Response headers:");
|
||||
Object.keys(headers).forEach((key) => {
|
||||
console.log(`${key}: ${headers[key]}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
return resp;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue