cassette
cassette copied to clipboard
Remove cassette.axd from URLs?
Is there any particular reason why "cassette.axd" has to be in all URLs generated by Cassette, and is there any way to change this?
From a security perspective, you shouldn't really expose what systems you are using on your server like this. In addition to it just adding extra length to URLs which should be neater.
This is one of two major things that is keeping me from using Cassette for my projects. (The other is the reliance on the antiquated dotless library for LESS support...)
I think Cassette uses this as a "catch all" route, so it handles anything from there, including assets referenced by CSS files.
But I think there are other ways today. As routing is integrated into ASP.NET, it could use a strategy similar to how ASP.NET Web Optimization does. It could register the bundles just by the names, and an extra catcher route to handle other assets. That could be set in web.config, so it would generate something like:
/libs/js <- actual bundle url /_assets/{reference_path} <- _assets would be the "catch all route" for assets, but we could change it to anything we want.
I've replaced "cassette.axd" with "bundles" everywhere in the Cassette project now, and it runs fine. There are some places it's used in regexes, so some care must be taken, but it should be fully possible to set this "prefix" to anything you want. Well, it is possible, I just did it, but it should be supported by default to override "cassette.axd" with something else.
Are there any plans to make this customizion possible as part of the official version/in a future update?