File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change 1
1
import type { NitroAppPlugin , RenderResponse } from 'nitropack'
2
- import { getRequestPath } from 'h3'
3
2
import { useChecker , getValidator , isIgnored } from './validator'
4
3
// @ts -expect-error virtual module
5
4
import config from '#html-validator-config'
@@ -11,7 +10,7 @@ export default <NitroAppPlugin> function (nitro) {
11
10
nitro . hooks . hook ( 'render:response' , async ( response : Partial < RenderResponse > , { event } ) => {
12
11
if ( typeof response . body === 'string' && ( response . headers ?. [ 'Content-Type' ] || response . headers ?. [ 'content-type' ] ) ?. includes ( 'html' ) && ! isIgnored ( event . path , config . ignore ) ) {
13
12
// 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 )
15
14
if ( config . hookable ) {
16
15
await nitro . hooks . callHook ( 'html-validator:check' , await promise , response , { event } )
17
16
}
You can’t perform that action at this time.
0 commit comments