-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add feature switch to control XmlResolver.IsNetworkingEnabledByDefault #34412
Conversation
@@ -626,6 +626,11 @@ Copyright (c) .NET Foundation. All rights reserved. | |||
<RuntimeHostConfigurationOption Include="System.Threading.ThreadPool.MaxThreads" | |||
Condition="'$(ThreadPoolMaxThreads)' != ''" | |||
Value="$(ThreadPoolMaxThreads)" /> | |||
|
|||
<RuntimeHostConfigurationOption Include="System.Xml.XmlResolver.IsNetworkingEnabledByDefault" |
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.
The STJ property controlling the System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault
swich was named JsonSerializerIsReflectionEnabledByDefault
. Echoing that naming convention, shouldn't this also be named XmlResolverIsNetworkingEnabledByDefault
?
Typically this needs to go through API review but maybe we can fast-track this. cc @eerhardt @bartonjs @terrajobst
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.
We've not done API review on these or they would be consistent.
The XXXSupport
is a prevalent theme for things that disable support for something
DebuggerSupport
, EventSourceSupport
, HttpActivityPropagationSupport
, MetadataUpdaterSupport
, NullabilityInfoContextSupport
, CustomResourceTypesSupport
, DynamicCodeSupport
, BuiltInComInteropSupport
,...
(The Json one is the odd one out)
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.
One difference between the existing XXXSupoort flags and the JsonSerializerIsReflectionEnabledByDefault flag is that the XXXSupport flags completely remove the ability for doing XXX. Where the JsonSerializer is still capable of doing reflection, it just won’t do it by default when the flag is set. Thus the verbose naming (it’s trying to be correct/precise).
I don’t know exactly which case the new XML flag falls into, but if the XmlResolver can still use networking even if the flag is set, I wouldn’t name it XXXSupport. Because it can still do it, even though the flag is set.
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.
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.
I'm not familiar with the code, but looking at this change suggests that it falls on the same boat as the STJ switch. It picks the XmlUrlResolver
implementation if the switch is turned on, which is a public class. The behavior of XmlUrlResolver
itself doesn't seem to be affected by the feature switch.
The choice of name for the feature switch also suggests similarity with the STJ one, so we might want to emulate naming convention for the property as well.
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.
@eiriktsarpalis @eerhardt if this updated name looks good, could you please merge? I'm off work through end of August. It would be nice to have this in 8.0.
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.
Thanks!
Fixes dotnet/runtime#89877.