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:
parent
58127d7fea
commit
91af6d3007
@ -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]
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user