@@ -365,7 +365,7 @@ const serveRedirect = async function ({
365
365
( await isEndpointExists ( decodeURIComponent ( reqUrl . pathname ) , options . target ) )
366
366
if ( staticFile || endpointExists ) {
367
367
const pathname = staticFile || reqUrl . pathname
368
- req . url = encodeURI ( pathname ) + reqUrl . search
368
+ req . url = encodeURI ( decodeURI ( pathname ) ) + reqUrl . search
369
369
// if there is an existing static file and it is not a forced redirect, return the file
370
370
if ( ! match . force ) {
371
371
return proxy . web ( req , res , { ...options , staticFile } )
@@ -858,7 +858,17 @@ const onRequest = async (
858
858
} ,
859
859
}
860
860
861
+ const maybeNotifyActivity = ( ) => {
862
+ if ( req . method === 'GET' && api && process . env . NETLIFY_DEV_SERVER_ID ) {
863
+ notifyActivity ( api , siteInfo . id , process . env . NETLIFY_DEV_SERVER_ID )
864
+ }
865
+ }
866
+
861
867
if ( match ) {
868
+ if ( ! isExternal ( match ) ) {
869
+ maybeNotifyActivity ( )
870
+ }
871
+
862
872
// We don't want to generate an ETag for 3xx redirects.
863
873
// @ts -expect-error TS(7031) FIXME: Binding element 'statusCode' implicitly has an 'an... Remove this comment to see the full error message
864
874
req [ shouldGenerateETag ] = ( { statusCode } ) => statusCode < 300 || statusCode >= 400
@@ -886,9 +896,7 @@ const onRequest = async (
886
896
return proxy . web ( req , res , { target : functionsServer } )
887
897
}
888
898
889
- if ( req . method === 'GET' && api && process . env . NETLIFY_DEV_SERVER_ID ) {
890
- notifyActivity ( api , siteInfo . id , process . env . NETLIFY_DEV_SERVER_ID )
891
- }
899
+ maybeNotifyActivity ( )
892
900
893
901
proxy . web ( req , res , options )
894
902
}
0 commit comments