@@ -27,10 +27,6 @@ const textDecoder = new TextDecoder();
2727const adminView = textDecoder . decode ( includeBytes ( 'src/views/admin.html' ) ) ;
2828const queueView = textDecoder . decode ( includeBytes ( 'src/views/queue.html' ) ) ;
2929
30- // For demo purposes
31- const demoManifest = textDecoder . decode ( includeBytes ( 'src/static/demo-manifest.md' ) ) ;
32- const DEMO_THUMBNAIL = includeBytes ( 'src/static/demo-thumb.png' ) ;
33-
3430// The name of the backend serving the content that is being protected by the queue.
3531const CONTENT_BACKEND = "protected_content" ;
3632
@@ -54,22 +50,6 @@ async function handleRequest(event) {
5450 const { request, client } = event ;
5551 const url = new URL ( request . url ) ;
5652
57- // Metadata foe developer.fastly.com.
58- // Feel free to delete this.
59- if ( url . pathname == "/.well-known/fastly/demo-manifest" ) {
60- return new Response ( demoManifest , {
61- status : 200 ,
62- headers : {
63- "Content-Type" : "text/markdown" ,
64- } ,
65- } ) ;
66- } else if ( url . pathname == "/demo-thumb.png" ) {
67- return new Response ( DEMO_THUMBNAIL , {
68- status : 200 ,
69- headers : { 'content-type' : 'image/png' }
70- } ) ;
71- }
72-
7353 // Allow requests to assets that are not protected by the queue.
7454 if ( ALLOWED_PATHS . includes ( url . pathname ) ) {
7555 let resp = await handleAuthorizedRequest ( request ) ;
@@ -124,11 +104,10 @@ async function handleRequest(event) {
124104 if ( payload && isValid ) {
125105 visitorPosition = payload . position ;
126106 } else {
127- // Add a new visitor to the end of the queue.
128- // If demo padding is set in the config, the queue will grow by that amount.
107+ // Add 1 new visitor to the end of the queue.
129108 visitorPosition = await incrementQueueLength (
130109 redis ,
131- config . queue . demoPadding ? config . queue . demoPadding : 1
110+ 1
132111 ) ;
133112
134113 // Sign a JWT with the visitor's position.
0 commit comments