@@ -89,6 +89,20 @@ describe("Cloudflare-fronted VPS deployment", () => {
8989 expect ( headers ) . toContain ( "Strict-Transport-Security" ) ;
9090 } ) ;
9191
92+ it ( "keeps firmware 404 responses non-cacheable through the shared error page" , async ( ) => {
93+ const config = await readFile (
94+ join ( deploymentRoot , "nginx" , "10-pyble-dev-https.conf" ) ,
95+ "utf8" ,
96+ ) ;
97+
98+ expect ( config ) . toMatch (
99+ / m a p \$ r e q u e s t _ u r i \$ p y b l e _ n o t _ f o u n d _ c a c h e _ c o n t r o l \s * \{ [ \s \S ] * ?~ \^ \/ f i r m w a r e \/ " n o - s t o r e " ; [ \s \S ] * ?d e f a u l t " n o - c a c h e , n o - t r a n s f o r m " ; [ \s \S ] * ?\} / ,
100+ ) ;
101+ expect ( config ) . toMatch (
102+ / l o c a t i o n = \/ 4 0 4 \. h t m l \s * \{ [ \s \S ] * ?a d d _ h e a d e r C a c h e - C o n t r o l \$ p y b l e _ n o t _ f o u n d _ c a c h e _ c o n t r o l a l w a y s ; / ,
103+ ) ;
104+ } ) ;
105+
92106 it ( "routes the exact v0.4.2 public beta through the immutable firmware boundary" , async ( ) => {
93107 const config = await readFile (
94108 join ( deploymentRoot , "nginx" , "10-pyble-dev-https.conf" ) ,
@@ -416,6 +430,27 @@ describe("Cloudflare-fronted VPS deployment", () => {
416430 ) ;
417431 } ) ;
418432
433+ it ( "requires missing firmware and deferred C3 smoke responses to be 404 no-store" , async ( ) => {
434+ const script = await readFile (
435+ join ( deploymentRoot , "vps" , "deploy.sh" ) ,
436+ "utf8" ,
437+ ) ;
438+ const smokeStart = script . indexOf ( "firmware_not_found_paths=(" ) ;
439+ const smokeEnd = script . indexOf ( "confirm_activation" , smokeStart ) ;
440+ const firmwareNotFoundSmoke = script . slice ( smokeStart , smokeEnd ) ;
441+
442+ expect ( smokeStart ) . toBeGreaterThan ( - 1 ) ;
443+ expect ( smokeEnd ) . toBeGreaterThan ( smokeStart ) ;
444+ expect ( firmwareNotFoundSmoke ) . toContain ( "/firmware/not-found-smoke" ) ;
445+ expect ( firmwareNotFoundSmoke ) . toContain ( "esp32-c3-4mb/manifest.json" ) ;
446+ expect ( firmwareNotFoundSmoke ) . toContain ( "--dump-header" ) ;
447+ expect ( firmwareNotFoundSmoke ) . toContain ( "--write-out '%{http_code}'" ) ;
448+ expect ( firmwareNotFoundSmoke ) . toMatch (
449+ / f i r m w a r e _ n o t _ f o u n d _ s t a t u s [ \s \S ] * ?! = 4 0 4 / ,
450+ ) ;
451+ expect ( firmwareNotFoundSmoke ) . toContain ( "Cache-Control: *no-store" ) ;
452+ } ) ;
453+
419454 it ( "freezes one clean full source commit through the completed website build" , async ( ) => {
420455 const script = await readFile (
421456 join ( deploymentRoot , "vps" , "deploy.sh" ) ,
0 commit comments