nuxt-community / redirect-module

No more cumbersome redirects for Nuxt 2!
MIT License
312 stars 17 forks source link

Support for case insensitive pattern #85

Open japboy opened 4 years ago

japboy commented 4 years ago

It woulb be great if case insensitive redirect pattern is supported :D

benjamin-richardson-circular commented 1 year ago

I just tried to use a regex literal string in order to add a case insensitive flag and it works fine.

{from: /^\/case-insensitive-url/i, to: '/my/redirect', statusCode: 301},

image

This works because in the module it tries to create a regex from the string in the 'from' field. But if you already have a regex, the new RegExp() in the module code will just let it pass through untouched.