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 11import type { NitroAppPlugin , RenderResponse } from 'nitropack'
2- import { getRequestPath } from 'h3'
32import { useChecker , getValidator , isIgnored } from './validator'
43// @ts -expect-error virtual module
54import 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 }
You can’t perform that action at this time.
0 commit comments