From bce976fecd21ddfb6c93f271e4b9c55e731312a3 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 16 Aug 2023 14:07:26 -0300 Subject: [PATCH] get rid of httpmethod enum. --- nip98.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/nip98.ts b/nip98.ts index 4fcdd39..f7a79e7 100644 --- a/nip98.ts +++ b/nip98.ts @@ -8,18 +8,6 @@ import { } from './event' import {utf8Decoder, utf8Encoder} from './utils' -enum HttpMethod { - Get = 'get', - Head = 'head', - Post = 'post' - Put = 'put' - Delete = 'delete' - Connect = 'connect' - Options = 'options' - Trace = 'trace' - Patch = 'patch' -} - const _authorizationScheme = 'Nostr ' /** @@ -31,7 +19,7 @@ const _authorizationScheme = 'Nostr ' */ export async function getToken( loginUrl: string, - httpMethod: HttpMethod | string, + httpMethod: string, sign: ( e: EventTemplate ) => Promise> | Event, @@ -39,8 +27,6 @@ export async function getToken( ): Promise { if (!loginUrl || !httpMethod) throw new Error('Missing loginUrl or httpMethod') - if (!httpMethod in HttpMethod) - throw new Error('Unknown httpMethod') const event = getBlankEvent(Kind.HttpAuth)