c.req.headers.get --> c.req.header, hono deprecation
This commit is contained in:
parent
bedc8fdf91
commit
c1bf326981
|
@ -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') {
|
||||
|
|
|
@ -117,7 +117,7 @@ function prepareFilters(filters: ClientREQ[2][]): Filter[] {
|
|||
}
|
||||
|
||||
const relayController: AppController = (c) => {
|
||||
const upgrade = c.req.headers.get('upgrade');
|
||||
const upgrade = c.req.header('upgrade');
|
||||
|
||||
if (upgrade?.toLowerCase() !== 'websocket') {
|
||||
return c.text('Please use a Nostr client to connect.', 400);
|
||||
|
|
|
@ -6,7 +6,7 @@ const BEARER_REGEX = new RegExp(`^Bearer (${nip19.BECH32_REGEX.source})$`);
|
|||
|
||||
/** NIP-19 auth middleware. */
|
||||
const auth19: AppMiddleware = async (c, next) => {
|
||||
const authHeader = c.req.headers.get('authorization');
|
||||
const authHeader = c.req.header('authorization');
|
||||
const match = authHeader?.match(BEARER_REGEX);
|
||||
|
||||
if (match) {
|
||||
|
|
|
@ -25,7 +25,7 @@ async function signEvent<K extends number = number>(
|
|||
opts: SignEventOpts = {},
|
||||
): Promise<Event<K>> {
|
||||
const seckey = c.get('seckey');
|
||||
const header = c.req.headers.get('x-nostr-sign');
|
||||
const header = c.req.header('x-nostr-sign');
|
||||
|
||||
if (seckey) {
|
||||
return finishEvent(event, seckey);
|
||||
|
|
Loading…
Reference in New Issue