toddams / RazorLight

Template engine based on Microsoft's Razor parsing engine for .NET Core
Apache License 2.0
1.51k stars 260 forks source link

Fix: respect DisableEncoding for cached templates #353

Closed DXInfinity closed 3 years ago

DXInfinity commented 4 years ago

DisableEncoding option was not applied to TemplatePage retrieved from cache.

jzabroski commented 4 years ago

@DXInfinity Can you add a test? Thank you for your help, and apologies I didn't see this PR sooner.

jzabroski commented 4 years ago

@DXInfinity Just a nudge on adding a test here. Thank you very much for the help with this PR.

HamiltonManalo commented 3 years ago

I jumped onto this branch to try and set up a couple of tests for it to get the PR merged through. It looks like the disable encoding option gets overwritten in the RazorEngineBuilder class. I'm examining the logic there to see if it can be an easy win. One immediate complexity I see, is that certain values for options could be combined, while others would overwrite. I'm going to default to throwing an error if both methods are used for the sake of consistency.

jzabroski commented 3 years ago

Addressed in subsequent PR #373 which includes test