Skip to content

Commit

Permalink
Fix pathname error on windows, fix #405
Browse files Browse the repository at this point in the history
  • Loading branch information
welefen committed Jul 28, 2016
1 parent 01bdfed commit 51d349f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/middleware/check_resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export default class extends think.middleware.base {
return null;
}
pathname = normalize(decodeURIComponent(pathname));
// replace \ to / on windows
pathname = pathname.replace(/\\/g, '/');
let reg = this.config('resource_reg');
if (!reg.test(pathname)) {
return null;
Expand Down

0 comments on commit 51d349f

Please sign in to comment.