WebAdministrationDsc
WebAdministrationDsc copied to clipboard
WebConfigPropertyCollection: Escape curly braces2
Pull Request (PR) description
Fix issue #430 by doubling up curly braces enabling the use of URLRewrite variables.
This Pull Request (PR) fixes the following issues
- Fixes #430
Task list
- [X] Added an entry to the change log under the Unreleased section of the file CHANGELOG.md. Entry should say what was changed and how that affects users (if applicable), and reference the issue being resolved (if applicable).
- [ ] Resource documentation added/updated in README.md.
- [ ] Resource parameter descriptions added/updated in README.md, schema.mof and comment-based help.
- [ ] Comment-based help added/updated.
- [ ] Localization strings added/updated in all localization files as appropriate.
- [ ] Examples appropriately added/updated.
- [ ] Unit tests added/updated. See DSC Community Testing Guidelines.
- [ ] Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
- [X] New/changed code adheres to DSC Community Style Guidelines.
This is a rework of https://github.com/dsccommunity/WebAdministrationDsc/pull/599 that had strange issues after the rebase was pushed. It's just one small helper function called when the filters are applied.
Codecov Report
Merging #612 (a190d48) into main (b2f3688) will decrease coverage by
2%
. The diff coverage is85%
.
@@ Coverage Diff @@
## main #612 +/- ##
====================================
- Coverage 90% 88% -3%
====================================
Files 18 15 -3
Lines 2773 1943 -830
====================================
- Hits 2515 1712 -803
+ Misses 258 231 -27
Impacted Files | Coverage Δ | |
---|---|---|
...urce/DSCResources/DSC_IisModule/DSC_IisModule.psm1 | 0% <0%> (ø) |
|
...urces/DSC_WebSiteDefaults/DSC_WebSiteDefaults.psm1 | 0% <0%> (ø) |
|
...rtyCollection/DSC_WebConfigPropertyCollection.psm1 | 97% <91%> (ø) |
|
...IisFeatureDelegation/DSC_IisFeatureDelegation.psm1 | 100% <100%> (ø) |
|
...ce/DSCResources/DSC_IisLogging/DSC_IisLogging.psm1 | 97% <100%> (ø) |
|
...DSC_IisMimeTypeMapping/DSC_IisMimeTypeMapping.psm1 | 100% <100%> (ø) |
|
.../DSCResources/DSC_SslSettings/DSC_SslSettings.psm1 | 81% <100%> (ø) |
|
...ce/DSCResources/DSC_WebAppPool/DSC_WebAppPool.psm1 | 95% <100%> (ø) |
|
...DSC_WebAppPoolDefaults/DSC_WebAppPoolDefaults.psm1 | 100% <100%> (ø) |
|
...sources/DSC_WebApplication/DSC_WebApplication.psm1 | 91% <100%> (ø) |
|
... and 5 more |
@johlju is there anyway I can help move this along?
I agree that you could remove the extra check for the data type since its already a string.
It's been a couple of years since I submitted the original PR, so I don't remember the details but I believe curly braces are supposed to be variables, and my intent was to make sure that variables with url rewrite were fixed and not to escape braces in all scenarios.
I think it checks for single vs double braces to avoid re-escaping something that's been escaped already and to reduce the odds of unintended issues. There may been a specific reason for it too, but I don't remember and I no longer have any IIS machines to test against.