Skip to content

Commit a3f9662

Browse files
Copilothotlong
andauthored
fix(studio): address code review nits - simplify extractBody, consistent Request creation
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/8923ba52-78fa-4a0c-8f11-edd6b20e611c Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 2e4de28 commit a3f9662

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

apps/studio/server/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ function extractBody(
257257
if (method === 'GET' || method === 'HEAD' || method === 'OPTIONS') return null;
258258

259259
if (incoming.rawBody != null) {
260-
if (typeof incoming.rawBody === 'string') return incoming.rawBody;
261260
return incoming.rawBody;
262261
}
263262

@@ -346,9 +345,7 @@ export default getRequestListener(async (request, env) => {
346345

347346
// For GET/HEAD/OPTIONS (or body-less requests): pass through with corrected URL.
348347
return await app.fetch(
349-
url !== request.url
350-
? new Request(url, { method, headers: request.headers })
351-
: request,
348+
new Request(url, { method, headers: request.headers }),
352349
);
353350
});
354351

0 commit comments

Comments
 (0)