Skip to content

Commit 34fe3f9

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/updatenode22
2 parents 48bf436 + 31f89a8 commit 34fe3f9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

ilc/server/app.spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,25 @@ describe('App', () => {
9595
chai.expect(responseCombined2.body.message).to.include('Data URIs');
9696
});
9797

98+
it('should block data URI in onRequest hook before wildcardRequestHandler (prevents FragmentError)', async () => {
99+
// Production NewRelic alert scenario: data URI reached wildcardRequestHandler -> special:404 -> FragmentError
100+
// This test verifies the fix: data URI blocked in onRequest with 400, never reaches wildcardRequestHandler
101+
const productionDataUri =
102+
'/data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJiIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMTQ0IiBoZWlnaHQ9IjY1NSI';
103+
104+
const response = await server.get(productionDataUri).expect(400);
105+
106+
// Verify: Blocked with 400 (not 404 which would indicate wildcardRequestHandler was reached)
107+
chai.expect(response.status).to.equal(400);
108+
chai.expect(response.body.message).to.include('Bad Request');
109+
chai.expect(response.body.message).to.include('Data URIs');
110+
111+
// Key assertion: Status is 400, not 404
112+
// If this were 404, it would mean wildcardRequestHandler processed it as special:404
113+
// which would trigger Tailor fragment fetching -> FragmentError in NewRelic
114+
chai.expect(response.status).to.not.equal(404);
115+
});
116+
98117
it('should parse "invalid" urls', async () => {
99118
await server.get('///').expect(200);
100119
});

0 commit comments

Comments
 (0)