@@ -35,6 +35,13 @@ Astro.response.headers.set('CDN-Cache-Control', 'public, max-age=60, stale-while
3535
3636const { locale, slug } = Astro .params ;
3737
38+ if (Astro .url .pathname .endsWith (' .json/' )) {
39+ return new Response (null , {
40+ status: 404 ,
41+ statusText: ' Not Found' ,
42+ });
43+ }
44+
3845// Validate locale
3946if (! locale || ! LOCALES .includes (locale as Locale ) || locale === DEFAULT_LOCALE ) {
4047 return Astro .redirect (' /workflows/' );
@@ -61,7 +68,10 @@ if (detailShareId) {
6168 if (! is404 ) {
6269 console .error (' Hub API error on ISR detail:' , err );
6370 }
64- return Astro .redirect (` /${locale }/workflows/ ` );
71+ return new Response (null , {
72+ status: 404 ,
73+ statusText: ' Not Found' ,
74+ });
6575 }
6676}
6777
@@ -130,7 +140,10 @@ try {
130140// link): no profile and no workflows — redirect instead of rendering a page
131141// that would title itself "<slug> (@<slug>)" and get indexed by Google.
132142if (! isDetailPage && ! profileFound && serialized .length === 0 ) {
133- return Astro .redirect (` /${locale }/workflows/ ` );
143+ return new Response (null , {
144+ status: 404 ,
145+ statusText: ' Not Found' ,
146+ });
134147}
135148
136149const canonicalUrl = absoluteUrl (` /workflows/${slug }/ ` );
0 commit comments