File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,13 @@ const miscHandlers = [
5454 } ,
5555 ) ,
5656 http . head ( 'https://www.gravatar.com/avatar/:md5Hash' , async ( ) => {
57- // In mocks mode we want deterministic behavior and to avoid external HTTP
58- // requests that can flake in CI (even when DNS works).
57+ // In development, allow real Gravatar lookups when possible.
58+ // In tests/CI (and other non-dev modes), return 404 deterministically to
59+ // avoid flaky external HTTP requests.
60+ if ( process . env . NODE_ENV !== 'development' ) {
61+ return HttpResponse . json ( null , { status : 404 } )
62+ }
63+ if ( await isConnectedToTheInternet ( ) ) return passthrough ( )
5964 return HttpResponse . json ( null , { status : 404 } )
6065 } ) ,
6166 http . get ( / h t t p : \/ \/ ( l o c a l h o s t | 1 2 7 \. 0 \. 0 \. 1 ) : \d + \/ .* / , async ( ) =>
You can’t perform that action at this time.
0 commit comments