Skip to content

Commit

Permalink
getRequestContent 1s
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Oct 24, 2018
1 parent 0e70d6f commit 368f722
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lighthouse-core/gather/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,11 @@ class Driver {
* @param {number} timeout
* @return {Promise<string>}
*/
async getRequestContent(requestId, timeout = 5000) {
async getRequestContent(requestId, timeout = 1000) {
requestId = NetworkRequest.getRequestIdForBackend(requestId);

// Encoding issues may lead to hanging getResponseBody calls: https://github.com/GoogleChrome/lighthouse/pull/4718
// driver.sendCommand will handle timeout after 5s.
// driver.sendCommand will handle timeout after 1s.
this.setNextProtocolTimeout(timeout);
const result = await this.sendCommand('Network.getResponseBody', {requestId});
return result.body;
Expand Down
2 changes: 1 addition & 1 deletion proto/lighthouse-result.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum LighthouseError {
READ_FAILED = 16;
// Used when security error prevents page load.
INSECURE_DOCUMENT_REQUEST = 17;
// Used when security error prevents page load.
// Used when protocol command times out.
PROTOCOL_TIMEOUT = 18;
}

Expand Down

0 comments on commit 368f722

Please sign in to comment.