0
0
mirror of https://github.com/honojs/hono.git synced 2024-12-01 11:51:01 +01:00

refactor: denoify (#1344)

This commit is contained in:
Yusuke Wada 2023-08-18 16:13:04 +09:00 committed by GitHub
parent 58127d7fea
commit 91af6d3007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -107,7 +107,10 @@ class ClientRequestImpl {
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
export const hc = <T extends Hono<any, any, any>>(baseUrl: string, options?: ClientRequestOptions) => export const hc = <T extends Hono<any, any, any>>(
baseUrl: string,
options?: ClientRequestOptions
) =>
createProxy(async (opts) => { createProxy(async (opts) => {
const parts = [...opts.path] const parts = [...opts.path]

View File

@ -2,7 +2,7 @@ import type { MiddlewareHandler } from '../../types.ts'
import { sha1 } from '../../utils/crypto.ts' import { sha1 } from '../../utils/crypto.ts'
type ETagOptions = { type ETagOptions = {
retainedHeaders?: string[], retainedHeaders?: string[]
weak?: boolean weak?: boolean
} }
@ -13,7 +13,12 @@ type ETagOptions = {
* > Content-Location, Date, ETag, Expires, and Vary. * > Content-Location, Date, ETag, Expires, and Vary.
*/ */
const RETAINED_304_HEADERS = [ const RETAINED_304_HEADERS = [
'cache-control', 'content-location', 'date', 'etag', 'expires', 'vary' 'cache-control',
'content-location',
'date',
'etag',
'expires',
'vary',
] ]
function etagMatches(etag: string, ifNoneMatch: string | null) { function etagMatches(etag: string, ifNoneMatch: string | null) {