[ci] format

This commit is contained in:
matthewp 2023-09-21 12:58:10 +00:00 committed by astrobot-houston
parent bcad715ce6
commit a576ba9c37
2 changed files with 7 additions and 3 deletions

View file

@ -1,2 +1,6 @@
export { AstroCookies } from './cookies.js'; export { AstroCookies } from './cookies.js';
export { attachCookiesToResponse, responseHasCookies, getSetCookiesFromResponse } from './response.js'; export {
attachCookiesToResponse,
getSetCookiesFromResponse,
responseHasCookies,
} from './response.js';

View file

@ -5,9 +5,9 @@ import type {
MiddlewareHandler, MiddlewareHandler,
MiddlewareNext, MiddlewareNext,
} from '../../@types/astro.js'; } from '../../@types/astro.js';
import { attachCookiesToResponse, responseHasCookies } from '../cookies/index.js';
import { AstroError, AstroErrorData } from '../errors/index.js'; import { AstroError, AstroErrorData } from '../errors/index.js';
import type { Environment } from '../render/index.js'; import type { Environment } from '../render/index.js';
import { attachCookiesToResponse, responseHasCookies } from '../cookies/index.js';
/** /**
* Utility function that is in charge of calling the middleware. * Utility function that is in charge of calling the middleware.
@ -112,7 +112,7 @@ export async function callMiddleware<R>(
} }
function ensureCookiesAttached(apiContext: APIContext, response: Response): Response { function ensureCookiesAttached(apiContext: APIContext, response: Response): Response {
if(apiContext.cookies !== undefined && !responseHasCookies(response)) { if (apiContext.cookies !== undefined && !responseHasCookies(response)) {
attachCookiesToResponse(response, apiContext.cookies); attachCookiesToResponse(response, apiContext.cookies);
} }
return response; return response;