Revert "Merge mintaka lib"

This reverts commit c6136b6e21.
This commit is contained in:
2024-03-21 12:28:47 -03:00
parent c6136b6e21
commit 23c6f5b30a
15 changed files with 23 additions and 747 deletions

View File

@ -1,28 +0,0 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: MIT
import { RawStringMap, StringMap } from "../collections/string_map";
/**
* Http Header Map
*
* Helper type to represent HTTP headers.
*/
export type HttpHeaderMap = RawStringMap<string>;
/**
* Http Headers
*
* Helper class to manage HTTP headers.
*/
export class HttpHeaders extends StringMap<string> {
public static parseAuthorizationHeader(value: string): { scheme: string, token: string } {
const parts = value.split(" ");
if (parts.length !== 2) {
throw new Error("Invalid authorization header");
}
return { scheme: parts[0], token: parts[1] };
}
}