diff --git a/src/context.ts b/src/context.ts index e3dbc3c5..882103c9 100644 --- a/src/context.ts +++ b/src/context.ts @@ -328,6 +328,8 @@ interface ResponseInit { export const TEXT_PLAIN = 'text/plain; charset=UTF-8' +export const APPLICATION_JSON = 'application/json; charset=UTF-8' + /** * Sets the headers of a response. * @@ -828,7 +830,7 @@ export class Context< ): JSONRespondReturn => { const body = JSON.stringify(object) this.#preparedHeaders ??= {} - this.#preparedHeaders['content-type'] = 'application/json; charset=UTF-8' + this.#preparedHeaders['content-type'] = APPLICATION_JSON /* eslint-disable @typescript-eslint/no-explicit-any */ return ( typeof arg === 'number' ? this.newResponse(body, arg, headers) : this.newResponse(body, arg)