Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/start-server-core/src/request-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export function clearSession(config: Partial<SessionConfig>): Promise<void> {
// not public API
export function getResponse() {
const event = getH3Event()
return event._res
return event.res
}

// not public API (yet)
Expand Down
16 changes: 8 additions & 8 deletions packages/start-server-core/src/server-functions-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ export const handleServerAction = async ({
return new Response(
nonStreamingBody ? JSON.stringify(nonStreamingBody) : undefined,
{
status: response?.status,
statusText: response?.statusText,
status: response.status,
statusText: response.statusText,
headers: {
'Content-Type': 'application/json',
[X_TSS_SERIALIZED]: 'true',
Expand Down Expand Up @@ -251,8 +251,8 @@ export const handleServerAction = async ({
},
})
return new Response(stream, {
status: response?.status,
statusText: response?.statusText,
status: response.status,
statusText: response.statusText,
headers: {
'Content-Type': 'application/x-ndjson',
[X_TSS_SERIALIZED]: 'true',
Expand All @@ -261,8 +261,8 @@ export const handleServerAction = async ({
}

return new Response(undefined, {
status: response?.status,
statusText: response?.statusText,
status: response.status,
statusText: response.statusText,
})
} catch (error: any) {
if (error instanceof Response) {
Expand Down Expand Up @@ -301,8 +301,8 @@ export const handleServerAction = async ({
)
const response = getResponse()
return new Response(serializedError, {
status: response?.status ?? 500,
statusText: response?.statusText,
status: response.status ?? 500,
statusText: response.statusText,
headers: {
'Content-Type': 'application/json',
[X_TSS_SERIALIZED]: 'true',
Expand Down
Loading