File tree Expand file tree Collapse file tree
packages/astro/src/core/endpoint Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,7 +96,11 @@ export let ResponseWithEncoding: ReturnType<typeof initResponseWithEncoding>;
9696// TODO Remove this after StackBlitz supports Node 18.
9797let initResponseWithEncoding = ( ) => {
9898 class LocalResponseWithEncoding extends Response {
99- constructor ( body : ResponseParameters [ 0 ] , init : ResponseParameters [ 1 ] , encoding ?: BufferEncoding ) {
99+ constructor (
100+ body : ResponseParameters [ 0 ] ,
101+ init : ResponseParameters [ 1 ] ,
102+ encoding ?: BufferEncoding
103+ ) {
100104 // If a body string is given, try to encode it to preserve the behaviour as simple objects.
101105 // We don't do the full handling as simple objects so users can control how headers are set instead.
102106 if ( typeof body === 'string' ) {
@@ -109,9 +113,9 @@ let initResponseWithEncoding = () => {
109113 body = encoder . encode ( body ) ;
110114 }
111115 }
112-
116+
113117 super ( body , init ) ;
114-
118+
115119 if ( encoding ) {
116120 this . headers . set ( 'X-Astro-Encoding' , encoding ) ;
117121 }
@@ -125,7 +129,7 @@ let initResponseWithEncoding = () => {
125129 initResponseWithEncoding = ( ( ) => { } ) as any ;
126130
127131 return LocalResponseWithEncoding ;
128- }
132+ } ;
129133
130134export async function callEndpoint < MiddlewareResult = Response | EndpointOutput > (
131135 mod : EndpointHandler ,
You can’t perform that action at this time.
0 commit comments