From fd29ac5e887700dd095a90939ca9ea658c7489e5 Mon Sep 17 00:00:00 2001 From: ahmed Date: Wed, 4 Mar 2026 00:21:55 -0600 Subject: [PATCH 1/2] feat: support raw-http annotation --- src/lib/run-dev.js | 4 +++- test/lib/run-dev.test.js | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/lib/run-dev.js b/src/lib/run-dev.js index 190173b..3c71a51 100644 --- a/src/lib/run-dev.js +++ b/src/lib/run-dev.js @@ -251,9 +251,11 @@ function isWebAction (action) { function isRawWebAction (action) { const raw = 'raw' const webExportValue = action?.annotations?.['web-export'] + const rawHttpValue = action?.annotations?.['raw-http'] + const isRawHttp = rawHttpValue === true || rawHttpValue === 'yes' || rawHttpValue === 'true' const webValue = action?.web - return (webExportValue === raw || webValue === raw) + return (webExportValue === raw || webValue === raw || isRawHttp) } /** diff --git a/test/lib/run-dev.test.js b/test/lib/run-dev.test.js index 5eb0ce7..be9984c 100644 --- a/test/lib/run-dev.test.js +++ b/test/lib/run-dev.test.js @@ -520,6 +520,32 @@ describe('isRawWebAction', () => { }) }) +test('action.annotations.raw-http', () => { + let action + + action = { annotations: {} } + expect(isRawWebAction(action)).toBeFalsy() + + action = { annotations: { 'raw-http': 'raw' } } + expect(isRawWebAction(action)).toBeFalsy() + + action = { annotations: { 'raw-http': 'any other string value' } } + expect(isRawWebAction(action)).toBeFalsy() + + action = { annotations: { 'raw-http': false } } + expect(isRawWebAction(action)).toBeFalsy() + + action = { annotations: { 'raw-http': true } } + expect(isRawWebAction(action)).toBeTruthy() + + action = { annotations: { 'raw-http': 'yes' } } + expect(isRawWebAction(action)).toBeTruthy() + + action = { annotations: { 'raw-http': 'true' } } + expect(isRawWebAction(action)).toBeTruthy() +}) + + describe('statusCodeMessage', () => { test('900 - invalid', () => { const statusCode = 900 From 39273c4bac36d3659395ca2528d642f06058be54 Mon Sep 17 00:00:00 2001 From: Ahmed Date: Wed, 4 Mar 2026 00:41:44 -0600 Subject: [PATCH 2/2] chore: lint --- test/lib/run-dev.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/lib/run-dev.test.js b/test/lib/run-dev.test.js index be9984c..de91af0 100644 --- a/test/lib/run-dev.test.js +++ b/test/lib/run-dev.test.js @@ -545,7 +545,6 @@ test('action.annotations.raw-http', () => { expect(isRawWebAction(action)).toBeTruthy() }) - describe('statusCodeMessage', () => { test('900 - invalid', () => { const statusCode = 900