c.req.headers.get --> c.req.header, hono deprecation

This commit is contained in:
Alex Gleason
2023-11-20 12:39:20 -06:00
parent bedc8fdf91
commit c1bf326981
4 changed files with 5 additions and 5 deletions

View File

@@ -28,8 +28,8 @@ const streamSchema = z.enum([
type Stream = z.infer<typeof streamSchema>;
const streamingController: AppController = (c) => {
const upgrade = c.req.headers.get('upgrade');
const token = c.req.headers.get('sec-websocket-protocol');
const upgrade = c.req.header('upgrade');
const token = c.req.header('sec-websocket-protocol');
const stream = streamSchema.optional().catch(undefined).parse(c.req.query('stream'));
if (upgrade?.toLowerCase() !== 'websocket') {