-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/protect file extensions #164
Feature/protect file extensions #164
Conversation
I ran into various errors after running
Please let me know if you would like me to check in the changes I made to remedy these issues. Respectively:
|
src/Smidge.Core/SmidgeConfig.cs
Outdated
@@ -34,6 +34,8 @@ public SmidgeConfig() | |||
public string Version => _config["version"] ?? "1"; | |||
|
|||
public string DataFolder => (_config["dataFolder"] ?? "Smidge").Replace('/', Path.DirectorySeparatorChar); | |||
|
|||
public bool ProtectFileExtensions => bool.Parse((_config["protectFileExtensions"] ?? "false")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is odd to me as there's nothing to protect. I think KeepFileExtensions would be a better name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also formatting is off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PhyxionNL I've renamed everything to keepFileExtensions
, including the 2 new tests as Keep_File_Extensions
.
I noticed the tabs vs.spaces on line 38. I'm going to save checking this in until I have addressed your related feedback.
Thank you!
@@ -160,8 +162,8 @@ public ParsedUrlPath ParsePath(string input) | |||
private string GetCompositeUrl(string fileKey, string fileExtension, string cacheBusterValue) | |||
{ | |||
//Create a delimited URL query string | |||
|
|||
const string handler = "~/{0}/{1}{2}.v{3}"; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the new line on 165. Had to do this outside of Visual Studio.
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the new line on 176. Had to do this outside of Visual Studio.
@Shazwazza or @PhyxionNL, I apologize for my persistence with this issue. Could either of you provide me some additional feedback, as I do have some time I can dedicate to working and addressing any problems or concerns? I do appreciate it. I appreciate your help, All the best, |
@Shazwazza if there is any feedback at all, I'm happy to try and implement the changes. Hope all is good sir! |
Sorry for the delay, having a look now |
Looks awesome, thanks so much 🎉 I'll ship a release asap |
This has been pushed :) https://github.com/Shazwazza/Smidge/releases/tag/v4.2.0 |
Protect File Extensions
I deployed the Umbraco CMS to a secure enterprise environment and encountered an issue. Our security policies blocked the static asset bundles produced by Smidge. After troubleshooting, we discovered that network requests were being blocked because the file extensions were unknown. Smidge's file naming pattern changes the file extension.
With this PR, I hope to remedy the above issue by opting in through a configuration value
protectFileExtensions
.Please review my PR and I appreciate any critical feedback. I am not a C# developer.
protectFileExtensions
..css
or.js
).protectFileExtensions
is set totrue
.Sample Settings
Previously, without
protectFileExtensions
Now, with
protectFileExtensions