Skip to content

Commit

Permalink
🐛 Remove size limit playground fetch API (#4214)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasrohmer authored Jul 23, 2020
1 parent e1fa2e2 commit 93f274e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions playground/backend/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ const log = require('@lib/utils/log')('Playground API');
*/
const MAX_AGE = 60 * 60;

/**
* Maximum file size that is streamed before a fetch is terminated in bytes.
* amp.dev's homepage is ~35KB - we allow triple the size
* @type {Number}
*/
const MAX_FILE_SIZE = 100800;

/**
* The time in milliseconds in which HOST_RATE_LIMIT requests can
* happen before the user needs to wait
Expand Down Expand Up @@ -64,8 +57,6 @@ const MAX_LIMITS = 500;
*/
async function fetchDocument(fetchUrl) {
const response = await fetch(fetchUrl, {
size: MAX_FILE_SIZE,
max: MAX_LIMITS,
headers: {
'Accept': 'text/html',
'x-requested-by': 'playground',
Expand All @@ -90,6 +81,7 @@ async function fetchDocument(fetchUrl) {
}

const limits = new LRU({
max: MAX_LIMITS,
maxAge: RATE_LIMIT_TIME_FRAME,
});

Expand Down

0 comments on commit 93f274e

Please sign in to comment.