You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I set Chinese in 'rewrites', it will not work normally. Check the source code and find that the reason is that the url in 'rewritesPlugin' is encoded and cannot match the incoming value.
// src/node/plugins/rewritesPlugin.tsexportconstrewritesPlugin=(config: SiteConfig): Plugin=>{return{name: 'vitepress:rewrites',configureServer(server){// dev rewriteserver.middlewares.use((req,_res,next)=>{// this url is encodedif(req.url){constpage=req.url.replace(/[?#].*$/,'').slice(config.site.base.length)// Value in 'rewrites.inv' not encodedif(config.rewrites.inv[page]){req.url=req.url.replace(page,config.rewrites.inv[page]!)}}next()})}}}
Reproduction
Use Chinese as the value of the 'rewrites' configuration
Describe the bug
If I set Chinese in 'rewrites', it will not work normally. Check the source code and find that the reason is that the url in 'rewritesPlugin' is encoded and cannot match the incoming value.
Reproduction
Use Chinese as the value of the 'rewrites' configuration
Expected behavior
The value passed in can be recognized normally
System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: