Skip to content

Commit 50c5d7d

Browse files
committed
fix: remove use of deprecated getRequestPath util
1 parent 75a74ea commit 50c5d7d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/runtime/nitro.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { NitroAppPlugin, RenderResponse } from 'nitropack'
2-
import { getRequestPath } from 'h3'
32
import { useChecker, getValidator, isIgnored } from './validator'
43
// @ts-expect-error virtual module
54
import config from '#html-validator-config'
@@ -11,7 +10,7 @@ export default <NitroAppPlugin> function (nitro) {
1110
nitro.hooks.hook('render:response', async (response: Partial<RenderResponse>, { event }) => {
1211
if (typeof response.body === 'string' && (response.headers?.['Content-Type'] || response.headers?.['content-type'])?.includes('html') && !isIgnored(event.path, config.ignore)) {
1312
// Block the response only if it's not hookable
14-
const promise = checkHTML(getRequestPath(event), response.body)
13+
const promise = checkHTML(event.path, response.body)
1514
if (config.hookable) {
1615
await nitro.hooks.callHook('html-validator:check', await promise, response, { event })
1716
}

0 commit comments

Comments
 (0)