Contributing: Fixed some typos (#18331)

This commit is contained in:
Maher Jendoubi 2020-01-14 17:58:52 +01:00 committed by Justin Kotalik
parent 6dd3d6ec49
commit 116799fa70
58 changed files with 285 additions and 285 deletions

View File

@ -54,7 +54,7 @@ Write-Output "Watching processes $($CandidateProcessNames -join ', ')";
# This script registers as a scheduled job. This scheduled job executes after $WakeTime. # This script registers as a scheduled job. This scheduled job executes after $WakeTime.
# When the scheduled job executes, it runs procdump on all alive processes whose name matches $CandidateProcessNames. # When the scheduled job executes, it runs procdump on all alive processes whose name matches $CandidateProcessNames.
# The dumps are placed in $ProcDumpOutputPath # The dumps are placed in $ProcDumpOutputPath
# If the build completes sucessfully in less than $WakeTime, a final step unregisters the job. # If the build completes successfully in less than $WakeTime, a final step unregisters the job.
# Create a unique identifier for the job name # Create a unique identifier for the job name
$JobName = "CaptureDumps" + (New-Guid).ToString("N"); $JobName = "CaptureDumps" + (New-Guid).ToString("N");

View File

@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
private bool _disposing = false; private bool _disposing = false;
/// <summary> /// <summary>
/// Notifies when a rendering exception occured. /// Notifies when a rendering exception occurred.
/// </summary> /// </summary>
public event EventHandler<Exception> UnhandledException; public event EventHandler<Exception> UnhandledException;

View File

@ -302,7 +302,7 @@ namespace Microsoft.AspNetCore.Components.Server
LoggerMessage.Define<CircuitId, string, string>(LogLevel.Debug, new EventId(7, "CreatedCircuit"), "Created circuit '{CircuitId}' with secret '{CircuitIdSecret}' for '{ConnectionId}'"); LoggerMessage.Define<CircuitId, string, string>(LogLevel.Debug, new EventId(7, "CreatedCircuit"), "Created circuit '{CircuitId}' with secret '{CircuitIdSecret}' for '{ConnectionId}'");
private static readonly Action<ILogger, string, Exception> _invalidCircuitId = private static readonly Action<ILogger, string, Exception> _invalidCircuitId =
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(8, "InvalidCircuitId"), "ConnectAsync recieved an invalid circuit id '{CircuitIdSecret}'"); LoggerMessage.Define<string>(LogLevel.Debug, new EventId(8, "InvalidCircuitId"), "ConnectAsync received an invalid circuit id '{CircuitIdSecret}'");
public static void ReceivedConfirmationForBatch(ILogger logger, long batchId) => _receivedConfirmationForBatch(logger, batchId, null); public static void ReceivedConfirmationForBatch(ILogger logger, long batchId) => _receivedConfirmationForBatch(logger, batchId, null);

View File

@ -90,7 +90,7 @@ namespace BlazingPizza.Server
}, },
new Topping() new Topping()
{ {
Name = "Fresh tomatos", Name = "Fresh tomatoes",
Price = 1.50m, Price = 1.50m,
}, },
new Topping() new Topping()

View File

@ -147,7 +147,7 @@ namespace Microsoft.AspNetCore.JsonPatch.IntegrationTests
} }
[Fact] [Fact]
public void TestStringProperty_IsSucessful() public void TestStringProperty_IsSuccessful()
{ {
// Arrange // Arrange
var targetObject = new var targetObject = new

View File

@ -106,7 +106,7 @@ namespace Microsoft.AspNetCore.JsonPatch.IntegrationTests
} }
[Fact] [Fact]
public void TestIntegerProperty_IsSucessful() public void TestIntegerProperty_IsSuccessful()
{ {
// Arrange // Arrange
dynamic targetObject = new ExpandoObject(); dynamic targetObject = new ExpandoObject();

View File

@ -91,7 +91,7 @@ namespace Microsoft.AspNetCore.Hosting
var startTimestamp = context.StartTimestamp; var startTimestamp = context.StartTimestamp;
long currentTimestamp = 0; long currentTimestamp = 0;
// If startTimestamp was 0, then Information logging wasn't enabled at for this request (and calcuated time will be wildly wrong) // If startTimestamp was 0, then Information logging wasn't enabled at for this request (and calculated time will be wildly wrong)
// Is used as proxy to reduce calls to virtual: _logger.IsEnabled(LogLevel.Information) // Is used as proxy to reduce calls to virtual: _logger.IsEnabled(LogLevel.Information)
if (startTimestamp != 0) if (startTimestamp != 0)
{ {
@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.Hosting
if (exception == null) if (exception == null)
{ {
// No exception was thrown, request was sucessful // No exception was thrown, request was successful
if (_diagnosticListener.IsEnabled(DeprecatedDiagnosticsEndRequestKey)) if (_diagnosticListener.IsEnabled(DeprecatedDiagnosticsEndRequestKey))
{ {
// Diagnostics is enabled for EndRequest, but it may not be for BeginRequest // Diagnostics is enabled for EndRequest, but it may not be for BeginRequest
@ -317,7 +317,7 @@ namespace Microsoft.AspNetCore.Hosting
private void StopActivity(Activity activity, HttpContext httpContext) private void StopActivity(Activity activity, HttpContext httpContext)
{ {
// Stop sets the end time if it was unset, but we want it set before we issue the write // Stop sets the end time if it was unset, but we want it set before we issue the write
// so we do it now. // so we do it now.
if (activity.Duration == TimeSpan.Zero) if (activity.Duration == TimeSpan.Zero)
{ {
activity.SetEndTime(DateTime.UtcNow); activity.SetEndTime(DateTime.UtcNow);

View File

@ -383,7 +383,7 @@ namespace Microsoft.AspNetCore.Routing
LogLevel.Debug, LogLevel.Debug,
EventIds.TemplateFailedExpansion, EventIds.TemplateFailedExpansion,
"Failed to process the template {Template} for {Endpoint}. " + "Failed to process the template {Template} for {Endpoint}. " +
"The failure occured while expanding the template with values {Values} " + "The failure occurred while expanding the template with values {Values} " +
"This is usually due to a missing or empty value in a complex segment"); "This is usually due to a missing or empty value in a complex segment");
private static readonly Action<ILogger, IEnumerable<string>, string, Exception> _linkGenerationSucceeded = LoggerMessage.Define<IEnumerable<string>, string>( private static readonly Action<ILogger, IEnumerable<string>, string, Exception> _linkGenerationSucceeded = LoggerMessage.Define<IEnumerable<string>, string>(
@ -442,7 +442,7 @@ namespace Microsoft.AspNetCore.Routing
} }
} }
public static void LinkGenerationSucceeded(ILogger logger, IEnumerable<Endpoint> endpoints, string uri) public static void LinkGenerationSucceeded(ILogger logger, IEnumerable<Endpoint> endpoints, string uri)
{ {
// Checking level again to avoid allocation on the common path // Checking level again to avoid allocation on the common path
if (logger.IsEnabled(LogLevel.Debug)) if (logger.IsEnabled(LogLevel.Debug))

View File

@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Routing.Matching
{ {
return Task.CompletedTask; return Task.CompletedTask;
} }
// Route values not supported // Route values not supported
[Fact] [Fact]
public override Task Match_SingleParameter_TrailingSlash() public override Task Match_SingleParameter_TrailingSlash()
@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Routing.Matching
// Route values not supported // Route values not supported
[Fact] [Fact]
public override Task Match_SingleParameter_WierdNames() public override Task Match_SingleParameter_WeirdNames()
{ {
return Task.CompletedTask; return Task.CompletedTask;
} }
@ -35,7 +35,7 @@ namespace Microsoft.AspNetCore.Routing.Matching
[InlineData(null, null, null, null)] [InlineData(null, null, null, null)]
public override Task Match_MultipleParameters(string template, string path, string[] keys, string[] values) public override Task Match_MultipleParameters(string template, string path, string[] keys, string[] values)
{ {
GC.KeepAlive(new object [] { template, path, keys, values }); GC.KeepAlive(new object[] { template, path, keys, values });
return Task.CompletedTask; return Task.CompletedTask;
} }

View File

@ -173,7 +173,7 @@ namespace Microsoft.AspNetCore.Routing.Matching
// Historically catchall segments don't match an empty segment, but only if it's // Historically catchall segments don't match an empty segment, but only if it's
// the first one. So `/a/b//` would match, but `/a//` would not. This is pretty // the first one. So `/a/b//` would match, but `/a//` would not. This is pretty
// wierd and inconsistent with the intent of using a catch all. The DfaMatcher // weird and inconsistent with the intent of using a catch all. The DfaMatcher
// fixes this issue. // fixes this issue.
[Theory] [Theory]
[InlineData("/{a}/{*b=b}", "/a///", new[] { "a", "b", }, new[] { "a", "//" })] [InlineData("/{a}/{*b=b}", "/a///", new[] { "a", "b", }, new[] { "a", "//" })]
@ -313,7 +313,7 @@ namespace Microsoft.AspNetCore.Routing.Matching
[InlineData("(Controller).mvc", "/(Controller).mvc", new string[] { }, new string[] { })] [InlineData("(Controller).mvc", "/(Controller).mvc", new string[] { }, new string[] { })]
[InlineData("Controller.mvc/ ", "/Controller.mvc/ ", new string[] { }, new string[] { })] [InlineData("Controller.mvc/ ", "/Controller.mvc/ ", new string[] { }, new string[] { })]
[InlineData("Controller.mvc ", "/Controller.mvc ", new string[] { }, new string[] { })] [InlineData("Controller.mvc ", "/Controller.mvc ", new string[] { }, new string[] { })]
public virtual async Task Match_WierdCharacterCases(string template, string path, string[] keys, string[] values) public virtual async Task Match_WeirdCharacterCases(string template, string path, string[] keys, string[] values)
{ {
// Arrange // Arrange
var (matcher, endpoint) = CreateMatcher(template); var (matcher, endpoint) = CreateMatcher(template);

View File

@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Routing.Matching
MatcherAssert.AssertMatch(httpContext, endpoint); MatcherAssert.AssertMatch(httpContext, endpoint);
} }
// Matchers should operate on the decoded representation - a matcher that calls // Matchers should operate on the decoded representation - a matcher that calls
// `httpContext.Request.Path.ToString()` will break this test. // `httpContext.Request.Path.ToString()` will break this test.
[Theory] [Theory]
[InlineData("/S%mple", "/S%mple")] [InlineData("/S%mple", "/S%mple")]
@ -239,7 +239,7 @@ namespace Microsoft.AspNetCore.Routing.Matching
} }
[Fact] [Fact]
public virtual async Task Match_SingleParameter_WierdNames() public virtual async Task Match_SingleParameter_WeirdNames()
{ {
// Arrange // Arrange
var (matcher, endpoint) = CreateMatcher("/foo/{ }/{.!$%}/{dynamic.data}"); var (matcher, endpoint) = CreateMatcher("/foo/{ }/{.!$%}/{dynamic.data}");

View File

@ -239,7 +239,7 @@ namespace Microsoft.AspNetCore.Routing.Patterns
} }
[Fact] [Fact]
public void Parse_ComplexSegment_ThreeParametersSeperatedByPeriod() public void Parse_ComplexSegment_ThreeParametersSeparatedByPeriod()
{ {
// Arrange // Arrange
var template = "{p1}.{p2}.{p3}"; var template = "{p1}.{p2}.{p3}";
@ -352,7 +352,7 @@ namespace Microsoft.AspNetCore.Routing.Patterns
[Theory] [Theory]
[InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}}$)}")] // extra } [InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}}$)}")] // extra }
[InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}$)}}")] // extra } at the end [InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}$)}}")] // extra } at the end
[InlineData(@"{{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}$)}")] // extra { at the begining [InlineData(@"{{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}$)}")] // extra { at the beginning
[InlineData(@"{p1:regex(([}])\w+}")] // Not escaped } [InlineData(@"{p1:regex(([}])\w+}")] // Not escaped }
[InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}$)}")] // Not escaped } [InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}$)}")] // Not escaped }
[InlineData(@"{p1:regex(abc)")] [InlineData(@"{p1:regex(abc)")]
@ -400,7 +400,7 @@ namespace Microsoft.AspNetCore.Routing.Patterns
[InlineData("..{p2?}", "..")] [InlineData("..{p2?}", "..")]
[InlineData("{p1}.abc.{p2?}", ".abc.")] [InlineData("{p1}.abc.{p2?}", ".abc.")]
[InlineData("{p1}{p2?}", "{p1}")] [InlineData("{p1}{p2?}", "{p1}")]
public void Parse_ComplexSegment_OptionalParametersSeperatedByPeriod_Invalid(string template, string parameter) public void Parse_ComplexSegment_OptionalParametersSeparatedByPeriod_Invalid(string template, string parameter)
{ {
// Act and Assert // Act and Assert
ExceptionAssert.Throws<RoutePatternException>( ExceptionAssert.Throws<RoutePatternException>(

View File

@ -325,7 +325,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests
} }
[Fact] [Fact]
public void Parse_ComplexSegment_ThreeParametersSeperatedByPeriod() public void Parse_ComplexSegment_ThreeParametersSeparatedByPeriod()
{ {
// Arrange // Arrange
var template = "{p1}.{p2}.{p3}"; var template = "{p1}.{p2}.{p3}";
@ -498,7 +498,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests
[Theory] [Theory]
[InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}}$)}")] // extra } [InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}}$)}")] // extra }
[InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}$)}}")] // extra } at the end [InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}$)}}")] // extra } at the end
[InlineData(@"{{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}$)}")] // extra { at the begining [InlineData(@"{{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}$)}")] // extra { at the beginning
[InlineData(@"{p1:regex(([}])\w+}")] // Not escaped } [InlineData(@"{p1:regex(([}])\w+}")] // Not escaped }
[InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}$)}")] // Not escaped } [InlineData(@"{p1:regex(^\d{{3}}-\d{{3}}-\d{{4}$)}")] // Not escaped }
[InlineData(@"{p1:regex(abc)")] [InlineData(@"{p1:regex(abc)")]
@ -550,7 +550,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests
[InlineData("{p1}.abc.{p2?}", ".abc.")] [InlineData("{p1}.abc.{p2?}", ".abc.")]
[InlineData("{p1}{p2?}", "{p1}")] [InlineData("{p1}{p2?}", "{p1}")]
[ReplaceCulture] [ReplaceCulture]
public void Parse_ComplexSegment_OptionalParametersSeperatedByPeriod_Invalid(string template, string parameter) public void Parse_ComplexSegment_OptionalParametersSeparatedByPeriod_Invalid(string template, string parameter)
{ {
// Act and Assert // Act and Assert
ExceptionAssert.Throws<ArgumentException>( ExceptionAssert.Throws<ArgumentException>(

View File

@ -167,7 +167,7 @@ namespace Microsoft.AspNetCore.WebUtilities
// If we're not in the final block, then consume nothing // If we're not in the final block, then consume nothing
if (!isFinalBlock) if (!isFinalBlock)
{ {
// Don't buffer indefinately // Don't buffer indefinitely
if ((uint)span.Length > (uint)KeyLengthLimit + (uint)ValueLengthLimit) if ((uint)span.Length > (uint)KeyLengthLimit + (uint)ValueLengthLimit)
{ {
ThrowKeyOrValueTooLargeException(); ThrowKeyOrValueTooLargeException();
@ -236,7 +236,7 @@ namespace Microsoft.AspNetCore.WebUtilities
{ {
if (!isFinalBlock) if (!isFinalBlock)
{ {
// Don't buffer indefinately // Don't buffer indefinitely
if ((uint)(sequenceReader.Consumed - consumedBytes) > (uint)KeyLengthLimit + (uint)ValueLengthLimit) if ((uint)(sequenceReader.Consumed - consumedBytes) > (uint)KeyLengthLimit + (uint)ValueLengthLimit)
{ {
ThrowKeyOrValueTooLargeException(); ThrowKeyOrValueTooLargeException();

View File

@ -85,7 +85,7 @@ namespace Microsoft.AspNetCore.WebUtilities
var anchorIndex = uri.IndexOf('#'); var anchorIndex = uri.IndexOf('#');
var uriToBeAppended = uri; var uriToBeAppended = uri;
var anchorText = ""; var anchorText = "";
// If there is an anchor, then the query string must be inserted before its first occurence. // If there is an anchor, then the query string must be inserted before its first occurrence.
if (anchorIndex != -1) if (anchorIndex != -1)
{ {
anchorText = uri.Substring(anchorIndex); anchorText = uri.Substring(anchorIndex);

View File

@ -406,7 +406,7 @@ HASH_TABLE<_Record,_Key>::InsertRecord(
) )
/*++ /*++
This method inserts a node for this record and also empty nodes for paths This method inserts a node for this record and also empty nodes for paths
in the heirarchy leading upto this path in the hierarchy leading upto this path
The insert is done under only a read-lock - this is possible by keeping The insert is done under only a read-lock - this is possible by keeping
the hashes in a bucket in increasing order and using interlocked operations the hashes in a bucket in increasing order and using interlocked operations

View File

@ -55,7 +55,7 @@ extern "C" {
#define HTTP_INITIALIZE_SERVER 0x00000001 #define HTTP_INITIALIZE_SERVER 0x00000001
#define HTTP_INITIALIZE_CONFIG 0x00000002 #define HTTP_INITIALIZE_CONFIG 0x00000002
#if _WIN32_WINNT <= 0x0501 #if _WIN32_WINNT <= 0x0501
#define BUILD_IIS_FOR_XP 1 #define BUILD_IIS_FOR_XP 1
#endif #endif
@ -582,7 +582,7 @@ typedef enum _HTTP_LOGGING_ROLLOVER_TYPE
// log file rollovers happen by GMT time. // log file rollovers happen by GMT time.
// //
// HTTP_LOGGING_FLAG_USE_UTF8_CONVERSION - When set the unicode fields // HTTP_LOGGING_FLAG_USE_UTF8_CONVERSION - When set the unicode fields
// will be converted to UTF8 multibytes when writting to the log // will be converted to UTF8 multibytes when writing to the log
// files. When this flag is not present, the local code page // files. When this flag is not present, the local code page
// conversion happens. // conversion happens.
// //
@ -1736,10 +1736,10 @@ typedef enum _HTTP_RESPONSE_INFO_TYPE
HttpResponseInfoTypeMultipleKnownHeaders, HttpResponseInfoTypeMultipleKnownHeaders,
HttpResponseInfoTypeAuthenticationProperty, HttpResponseInfoTypeAuthenticationProperty,
HttpResponseInfoTypeQoSProperty HttpResponseInfoTypeQoSProperty
#if _WIN32_WINNT >= _WIN32_WINNT_WIN7 || BUILD_IIS_FOR_XP #if _WIN32_WINNT >= _WIN32_WINNT_WIN7 || BUILD_IIS_FOR_XP
,HttpResponseInfoTypeChannelBind ,HttpResponseInfoTypeChannelBind
#endif #endif
} HTTP_RESPONSE_INFO_TYPE, PHTTP_RESPONSE_INFO_TYPE; } HTTP_RESPONSE_INFO_TYPE, PHTTP_RESPONSE_INFO_TYPE;

View File

@ -79,7 +79,7 @@ private:
); );
// //
// Pointer to the begining of the inlined array. // Pointer to the beginning of the inlined array.
// //
PVOID m_pVariables; PVOID m_pVariables;
SIZE_T m_Alignment; SIZE_T m_Alignment;
@ -101,7 +101,7 @@ PER_CPU<T>::Create(
DWORD ObjectCacheLineSize = 0; DWORD ObjectCacheLineSize = 0;
DWORD NumberOfProcessors = 0; DWORD NumberOfProcessors = 0;
PER_CPU<T> * pInstance = NULL; PER_CPU<T> * pInstance = NULL;
hr = GetProcessorInformation(&CacheLineSize, hr = GetProcessorInformation(&CacheLineSize,
&NumberOfProcessors); &NumberOfProcessors);
if (FAILED(hr)) if (FAILED(hr))
@ -140,7 +140,7 @@ PER_CPU<T>::Create(
// The array start in the 2nd cache line. // The array start in the 2nd cache line.
// //
pInstance->m_pVariables = reinterpret_cast<PBYTE>(pInstance) + CacheLineSize; pInstance->m_pVariables = reinterpret_cast<PBYTE>(pInstance) + CacheLineSize;
// //
// Pass a disposer for disposing initialized items in case of failure. // Pass a disposer for disposing initialized items in case of failure.
// //

View File

@ -519,7 +519,7 @@ TREE_HASH_TABLE<_Record>::InsertRecord(
) )
/*++ /*++
This method inserts a node for this record and also empty nodes for paths This method inserts a node for this record and also empty nodes for paths
in the heirarchy leading upto this path in the hierarchy leading upto this path
The insert is done under only a read-lock - this is possible by keeping The insert is done under only a read-lock - this is possible by keeping
the hashes in a bucket in increasing order and using interlocked operations the hashes in a bucket in increasing order and using interlocked operations

View File

@ -1637,7 +1637,7 @@ Arguments:
Return Value: Return Value:
The index for the first character occurence in the string. The index for the first character occurrence in the string.
-1 if not found. -1 if not found.
@ -1684,7 +1684,7 @@ Arguments:
Return Value: Return Value:
The index for the first character occurence in the string. The index for the first character occurrence in the string.
-1 if not found. -1 if not found.
@ -1733,7 +1733,7 @@ Arguments:
Return Value: Return Value:
The index for the last character occurence in the string. The index for the last character occurrence in the string.
-1 if not found. -1 if not found.

View File

@ -1083,7 +1083,7 @@ Arguments:
Return Value: Return Value:
The index for the first character occurence in the string. The index for the first character occurrence in the string.
-1 if not found. -1 if not found.
@ -1130,7 +1130,7 @@ Arguments:
Return Value: Return Value:
The index for the first character occurence in the string. The index for the first character occurrence in the string.
-1 if not found. -1 if not found.
@ -1179,7 +1179,7 @@ Arguments:
Return Value: Return Value:
The index for the last character occurence in the string. The index for the last character occurrence in the string.
-1 if not found. -1 if not found.

View File

@ -20,7 +20,7 @@ enum SETUP_LOG_SEVERITY
//consider using an IIS prefix for Msi* methods - they conflict with MSI apis //consider using an IIS prefix for Msi* methods - they conflict with MSI apis
// //
// Initalize logging once at begining of CA // Initialize logging once at beginning of CA
// //
VOID VOID
@ -31,7 +31,7 @@ IISLogInitialize(
// //
// Close logging at end / exit of CA // Close logging at end / exit of CA
// //
VOID VOID
IISLogClose( IISLogClose(
@ -40,7 +40,7 @@ IISLogClose(
// //
// Writes a message to msi log file // Writes a message to msi log file
// //
VOID VOID
IISLogWrite( IISLogWrite(
IN SETUP_LOG_SEVERITY setupLogSeverity, IN SETUP_LOG_SEVERITY setupLogSeverity,

View File

@ -72,14 +72,14 @@ namespace Microsoft.AspNetCore.SpaServices
public string SourcePath { get; set; } public string SourcePath { get; set; }
/// <summary> /// <summary>
/// Controls wether the development server should be used with a dynamic or fixed port. /// Controls whether the development server should be used with a dynamic or fixed port.
/// </summary> /// </summary>
public int DevServerPort { get; set; } = default(int); public int DevServerPort { get; set; } = default(int);
/// <summary> /// <summary>
/// Gets or sets the name of the package manager executible, (e.g npm, /// Gets or sets the name of the package manager executable, (e.g npm,
/// yarn) to run the SPA. /// yarn) to run the SPA.
/// ///
/// The default value is 'npm'. /// The default value is 'npm'.
/// </summary> /// </summary>
public string PackageManagerCommand public string PackageManagerCommand

View File

@ -61,30 +61,30 @@ $.extend($.fn, {
if ( validator ) { if ( validator ) {
return validator; return validator;
} }
validator = new $.validator( options, this[0] ); validator = new $.validator( options, this[0] );
$.data(this[0], 'validator', validator); $.data(this[0], 'validator', validator);
if ( validator.settings.onsubmit ) { if ( validator.settings.onsubmit ) {
// allow suppresing validation by adding a cancel class to the submit button // allow suppresing validation by adding a cancel class to the submit button
this.find("input, button").filter(".cancel").click(function() { this.find("input, button").filter(".cancel").click(function() {
validator.cancelSubmit = true; validator.cancelSubmit = true;
}); });
// when a submitHandler is used, capture the submitting button // when a submitHandler is used, capture the submitting button
if (validator.settings.submitHandler) { if (validator.settings.submitHandler) {
this.find("input, button").filter(":submit").click(function() { this.find("input, button").filter(":submit").click(function() {
validator.submitButton = this; validator.submitButton = this;
}); });
} }
// validate the form on submit // validate the form on submit
this.submit( function( event ) { this.submit( function( event ) {
if ( validator.settings.debug ) if ( validator.settings.debug )
// prevent form submit to be able to see console output // prevent form submit to be able to see console output
event.preventDefault(); event.preventDefault();
function handle() { function handle() {
if ( validator.settings.submitHandler ) { if ( validator.settings.submitHandler ) {
if (validator.submitButton) { if (validator.submitButton) {
@ -100,7 +100,7 @@ $.extend($.fn, {
} }
return true; return true;
} }
// prevent submit for invalid forms or custom submit handlers // prevent submit for invalid forms or custom submit handlers
if ( validator.cancelSubmit ) { if ( validator.cancelSubmit ) {
validator.cancelSubmit = false; validator.cancelSubmit = false;
@ -118,7 +118,7 @@ $.extend($.fn, {
} }
}); });
} }
return validator; return validator;
}, },
// http://docs.jquery.com/Plugins/Validation/valid // http://docs.jquery.com/Plugins/Validation/valid
@ -140,13 +140,13 @@ $.extend($.fn, {
return valid; return valid;
} }
}, },
// attributes: space seperated list of attributes to retrieve and remove // attributes: space separated list of attributes to retrieve and remove
removeAttrs: function(attributes) { removeAttrs: function(attributes) {
/// <summary> /// <summary>
/// Remove the specified attributes from the first matched element and return them. /// Remove the specified attributes from the first matched element and return them.
/// </summary> /// </summary>
/// <param name="attributes" type="String"> /// <param name="attributes" type="String">
/// A space-seperated list of attribute names to remove. /// A space-separated list of attribute names to remove.
/// </param> /// </param>
var result = {}, var result = {},
@ -170,7 +170,7 @@ $.extend($.fn, {
/// </param> /// </param>
var element = this[0]; var element = this[0];
if (command) { if (command) {
var settings = $.data(element.form, 'validator').settings; var settings = $.data(element.form, 'validator').settings;
var staticRules = settings.rules; var staticRules = settings.rules;
@ -195,7 +195,7 @@ $.extend($.fn, {
return filtered; return filtered;
} }
} }
var data = $.validator.normalizeRules( var data = $.validator.normalizeRules(
$.extend( $.extend(
{}, {},
@ -204,14 +204,14 @@ $.extend($.fn, {
$.validator.attributeRules(element), $.validator.attributeRules(element),
$.validator.staticRules(element) $.validator.staticRules(element)
), element); ), element);
// make sure required is at front // make sure required is at front
if (data.required) { if (data.required) {
var param = data.required; var param = data.required;
delete data.required; delete data.required;
data = $.extend({required: param}, data); data = $.extend({required: param}, data);
} }
return data; return data;
} }
}); });
@ -247,7 +247,7 @@ $.validator.format = function(source, params) {
/// </param> /// </param>
/// <returns type="String" /> /// <returns type="String" />
if ( arguments.length == 1 ) if ( arguments.length == 1 )
return function() { return function() {
var args = $.makeArray(arguments); var args = $.makeArray(arguments);
args.unshift(source); args.unshift(source);
@ -266,7 +266,7 @@ $.validator.format = function(source, params) {
}; };
$.extend($.validator, { $.extend($.validator, {
defaults: { defaults: {
messages: {}, messages: {},
groups: {}, groups: {},
@ -282,7 +282,7 @@ $.extend($.validator, {
ignoreTitle: false, ignoreTitle: false,
onfocusin: function(element) { onfocusin: function(element) {
this.lastActive = element; this.lastActive = element;
// hide error label and remove error class on focus if enabled // hide error label and remove error class on focus if enabled
if ( this.settings.focusCleanup && !this.blockFocusCleanup ) { if ( this.settings.focusCleanup && !this.blockFocusCleanup ) {
this.settings.unhighlight && this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); this.settings.unhighlight && this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
@ -347,11 +347,11 @@ $.extend($.validator, {
max: $.validator.format("Please enter a value less than or equal to {0}."), max: $.validator.format("Please enter a value less than or equal to {0}."),
min: $.validator.format("Please enter a value greater than or equal to {0}.") min: $.validator.format("Please enter a value greater than or equal to {0}.")
}, },
autoCreateRanges: false, autoCreateRanges: false,
prototype: { prototype: {
init: function() { init: function() {
this.labelContainer = $(this.settings.errorLabelContainer); this.labelContainer = $(this.settings.errorLabelContainer);
this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm); this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm);
@ -362,7 +362,7 @@ $.extend($.validator, {
this.pending = {}; this.pending = {};
this.invalid = {}; this.invalid = {};
this.reset(); this.reset();
var groups = (this.groups = {}); var groups = (this.groups = {});
$.each(this.settings.groups, function(key, value) { $.each(this.settings.groups, function(key, value) {
$.each(value.split(/\s/), function(index, name) { $.each(value.split(/\s/), function(index, name) {
@ -373,7 +373,7 @@ $.extend($.validator, {
$.each(rules, function(key, value) { $.each(rules, function(key, value) {
rules[key] = $.validator.normalizeRule(value); rules[key] = $.validator.normalizeRule(value);
}); });
function delegate(event) { function delegate(event) {
var validator = $.data(this[0].form, "validator"), var validator = $.data(this[0].form, "validator"),
eventType = "on" + event.type.replace(/^validate/, ""); eventType = "on" + event.type.replace(/^validate/, "");
@ -403,15 +403,15 @@ $.extend($.validator, {
this.showErrors(); this.showErrors();
return this.valid(); return this.valid();
}, },
checkForm: function() { checkForm: function() {
this.prepareForm(); this.prepareForm();
for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) { for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) {
this.check( elements[i] ); this.check( elements[i] );
} }
return this.valid(); return this.valid();
}, },
// http://docs.jquery.com/Plugins/Validation/Validator/element // http://docs.jquery.com/Plugins/Validation/Validator/element
element: function( element ) { element: function( element ) {
/// <summary> /// <summary>
@ -470,7 +470,7 @@ $.extend($.validator, {
? this.settings.showErrors.call( this, this.errorMap, this.errorList ) ? this.settings.showErrors.call( this, this.errorMap, this.errorList )
: this.defaultShowErrors(); : this.defaultShowErrors();
}, },
// http://docs.jquery.com/Plugins/Validation/Validator/resetForm // http://docs.jquery.com/Plugins/Validation/Validator/resetForm
resetForm: function() { resetForm: function() {
/// <summary> /// <summary>
@ -486,7 +486,7 @@ $.extend($.validator, {
this.hideErrors(); this.hideErrors();
this.elements().removeClass( this.settings.errorClass ); this.elements().removeClass( this.settings.errorClass );
}, },
numberOfInvalids: function() { numberOfInvalids: function() {
/// <summary> /// <summary>
/// Returns the number of invalid fields. /// Returns the number of invalid fields.
@ -499,26 +499,26 @@ $.extend($.validator, {
return this.objectLength(this.invalid); return this.objectLength(this.invalid);
}, },
objectLength: function( obj ) { objectLength: function( obj ) {
var count = 0; var count = 0;
for ( var i in obj ) for ( var i in obj )
count++; count++;
return count; return count;
}, },
hideErrors: function() { hideErrors: function() {
this.addWrapper( this.toHide ).hide(); this.addWrapper( this.toHide ).hide();
}, },
valid: function() { valid: function() {
return this.size() == 0; return this.size() == 0;
}, },
size: function() { size: function() {
return this.errorList.length; return this.errorList.length;
}, },
focusInvalid: function() { focusInvalid: function() {
if( this.settings.focusInvalid ) { if( this.settings.focusInvalid ) {
try { try {
@ -532,18 +532,18 @@ $.extend($.validator, {
} }
} }
}, },
findLastActive: function() { findLastActive: function() {
var lastActive = this.lastActive; var lastActive = this.lastActive;
return lastActive && $.grep(this.errorList, function(n) { return lastActive && $.grep(this.errorList, function(n) {
return n.element.name == lastActive.name; return n.element.name == lastActive.name;
}).length == 1 && lastActive; }).length == 1 && lastActive;
}, },
elements: function() { elements: function() {
var validator = this, var validator = this,
rulesCache = {}; rulesCache = {};
// select all valid inputs inside the form (no submit or reset buttons) // select all valid inputs inside the form (no submit or reset buttons)
// workaround $Query([]).add until http://dev.jquery.com/ticket/2114 is solved // workaround $Query([]).add until http://dev.jquery.com/ticket/2114 is solved
return $([]).add(this.currentForm.elements) return $([]).add(this.currentForm.elements)
@ -552,24 +552,24 @@ $.extend($.validator, {
.not( this.settings.ignore ) .not( this.settings.ignore )
.filter(function() { .filter(function() {
!this.name && validator.settings.debug && window.console && console.error( "%o has no name assigned", this); !this.name && validator.settings.debug && window.console && console.error( "%o has no name assigned", this);
// select only the first element for each name, and only those with rules specified // select only the first element for each name, and only those with rules specified
if ( this.name in rulesCache || !validator.objectLength($(this).rules()) ) if ( this.name in rulesCache || !validator.objectLength($(this).rules()) )
return false; return false;
rulesCache[this.name] = true; rulesCache[this.name] = true;
return true; return true;
}); });
}, },
clean: function( selector ) { clean: function( selector ) {
return $( selector )[0]; return $( selector )[0];
}, },
errors: function() { errors: function() {
return $( this.settings.errorElement + "." + this.settings.errorClass, this.errorContext ); return $( this.settings.errorElement + "." + this.settings.errorClass, this.errorContext );
}, },
reset: function() { reset: function() {
this.successList = []; this.successList = [];
this.errorList = []; this.errorList = [];
@ -578,32 +578,32 @@ $.extend($.validator, {
this.toHide = $([]); this.toHide = $([]);
this.currentElements = $([]); this.currentElements = $([]);
}, },
prepareForm: function() { prepareForm: function() {
this.reset(); this.reset();
this.toHide = this.errors().add( this.containers ); this.toHide = this.errors().add( this.containers );
}, },
prepareElement: function( element ) { prepareElement: function( element ) {
this.reset(); this.reset();
this.toHide = this.errorsFor(element); this.toHide = this.errorsFor(element);
}, },
check: function( element ) { check: function( element ) {
element = this.clean( element ); element = this.clean( element );
// if radio/checkbox, validate first element in group instead // if radio/checkbox, validate first element in group instead
if (this.checkable(element)) { if (this.checkable(element)) {
element = this.findByName(element.name).not(this.settings.ignore)[0]; element = this.findByName(element.name).not(this.settings.ignore)[0];
} }
var rules = $(element).rules(); var rules = $(element).rules();
var dependencyMismatch = false; var dependencyMismatch = false;
for (var method in rules) { for (var method in rules) {
var rule = { method: method, parameters: rules[method] }; var rule = { method: method, parameters: rules[method] };
try { try {
var result = $.validator.methods[method].call( this, element.value.replace(/\r/g, ""), element, rule.parameters ); var result = $.validator.methods[method].call( this, element.value.replace(/\r/g, ""), element, rule.parameters );
// if a method indicates that the field is optional and therefore valid, // if a method indicates that the field is optional and therefore valid,
// don't mark it as valid when there are no other rules // don't mark it as valid when there are no other rules
if ( result == "dependency-mismatch" ) { if ( result == "dependency-mismatch" ) {
@ -611,12 +611,12 @@ $.extend($.validator, {
continue; continue;
} }
dependencyMismatch = false; dependencyMismatch = false;
if ( result == "pending" ) { if ( result == "pending" ) {
this.toHide = this.toHide.not( this.errorsFor(element) ); this.toHide = this.toHide.not( this.errorsFor(element) );
return; return;
} }
if( !result ) { if( !result ) {
this.formatAndAdd( element, rule ); this.formatAndAdd( element, rule );
return false; return false;
@ -633,20 +633,20 @@ $.extend($.validator, {
this.successList.push(element); this.successList.push(element);
return true; return true;
}, },
// return the custom message for the given element and validation method // return the custom message for the given element and validation method
// specified in the element's "messages" metadata // specified in the element's "messages" metadata
customMetaMessage: function(element, method) { customMetaMessage: function(element, method) {
if (!$.metadata) if (!$.metadata)
return; return;
var meta = this.settings.meta var meta = this.settings.meta
? $(element).metadata()[this.settings.meta] ? $(element).metadata()[this.settings.meta]
: $(element).metadata(); : $(element).metadata();
return meta && meta.messages && meta.messages[method]; return meta && meta.messages && meta.messages[method];
}, },
// return the custom message for the given element name and validation method // return the custom message for the given element name and validation method
customMessage: function( name, method ) { customMessage: function( name, method ) {
var m = this.settings.messages[name]; var m = this.settings.messages[name];
@ -654,7 +654,7 @@ $.extend($.validator, {
? m ? m
: m[method]); : m[method]);
}, },
// return the first defined argument, allowing empty strings // return the first defined argument, allowing empty strings
findDefined: function() { findDefined: function() {
for(var i = 0; i < arguments.length; i++) { for(var i = 0; i < arguments.length; i++) {
@ -663,7 +663,7 @@ $.extend($.validator, {
} }
return undefined; return undefined;
}, },
defaultMessage: function( element, method) { defaultMessage: function( element, method) {
return this.findDefined( return this.findDefined(
this.customMessage( element.name, method ), this.customMessage( element.name, method ),
@ -674,7 +674,7 @@ $.extend($.validator, {
"<strong>Warning: No message defined for " + element.name + "</strong>" "<strong>Warning: No message defined for " + element.name + "</strong>"
); );
}, },
formatAndAdd: function( element, rule ) { formatAndAdd: function( element, rule ) {
var message = this.defaultMessage( element, rule.method ), var message = this.defaultMessage( element, rule.method ),
theregex = /\$?\{(\d+)\}/g; theregex = /\$?\{(\d+)\}/g;
@ -682,22 +682,22 @@ $.extend($.validator, {
message = message.call(this, rule.parameters, element); message = message.call(this, rule.parameters, element);
} else if (theregex.test(message)) { } else if (theregex.test(message)) {
message = jQuery.format(message.replace(theregex, '{$1}'), rule.parameters); message = jQuery.format(message.replace(theregex, '{$1}'), rule.parameters);
} }
this.errorList.push({ this.errorList.push({
message: message, message: message,
element: element element: element
}); });
this.errorMap[element.name] = message; this.errorMap[element.name] = message;
this.submitted[element.name] = message; this.submitted[element.name] = message;
}, },
addWrapper: function(toToggle) { addWrapper: function(toToggle) {
if ( this.settings.wrapper ) if ( this.settings.wrapper )
toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) );
return toToggle; return toToggle;
}, },
defaultShowErrors: function() { defaultShowErrors: function() {
for ( var i = 0; this.errorList[i]; i++ ) { for ( var i = 0; this.errorList[i]; i++ ) {
var error = this.errorList[i]; var error = this.errorList[i];
@ -721,23 +721,23 @@ $.extend($.validator, {
this.hideErrors(); this.hideErrors();
this.addWrapper( this.toShow ).show(); this.addWrapper( this.toShow ).show();
}, },
validElements: function() { validElements: function() {
return this.currentElements.not(this.invalidElements()); return this.currentElements.not(this.invalidElements());
}, },
invalidElements: function() { invalidElements: function() {
return $(this.errorList).map(function() { return $(this.errorList).map(function() {
return this.element; return this.element;
}); });
}, },
showLabel: function(element, message) { showLabel: function(element, message) {
var label = this.errorsFor( element ); var label = this.errorsFor( element );
if ( label.length ) { if ( label.length ) {
// refresh error/success class // refresh error/success class
label.removeClass().addClass( this.settings.errorClass ); label.removeClass().addClass( this.settings.errorClass );
// check if we have a generated label, replace the message then // check if we have a generated label, replace the message then
label.attr("generated") && label.html(message); label.attr("generated") && label.html(message);
} else { } else {
@ -764,14 +764,14 @@ $.extend($.validator, {
} }
this.toShow = this.toShow.add(label); this.toShow = this.toShow.add(label);
}, },
errorsFor: function(element) { errorsFor: function(element) {
var name = this.idOrName(element); var name = this.idOrName(element);
return this.errors().filter(function() { return this.errors().filter(function() {
return $(this).attr('for') == name; return $(this).attr('for') == name;
}); });
}, },
idOrName: function(element) { idOrName: function(element) {
return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name); return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name);
}, },
@ -779,7 +779,7 @@ $.extend($.validator, {
checkable: function( element ) { checkable: function( element ) {
return /radio|checkbox/i.test(element.type); return /radio|checkbox/i.test(element.type);
}, },
findByName: function( name ) { findByName: function( name ) {
// select by name and filter by form for performance over form.find("[name=...]") // select by name and filter by form for performance over form.find("[name=...]")
var form = this.currentForm; var form = this.currentForm;
@ -787,7 +787,7 @@ $.extend($.validator, {
return element.form == form && element.name == name && element || null; return element.form == form && element.name == name && element || null;
}); });
}, },
getLength: function(value, element) { getLength: function(value, element) {
switch( element.nodeName.toLowerCase() ) { switch( element.nodeName.toLowerCase() ) {
case 'select': case 'select':
@ -798,13 +798,13 @@ $.extend($.validator, {
} }
return value.length; return value.length;
}, },
depend: function(param, element) { depend: function(param, element) {
return this.dependTypes[typeof param] return this.dependTypes[typeof param]
? this.dependTypes[typeof param](param, element) ? this.dependTypes[typeof param](param, element)
: true; : true;
}, },
dependTypes: { dependTypes: {
"boolean": function(param, element) { "boolean": function(param, element) {
return param; return param;
@ -816,18 +816,18 @@ $.extend($.validator, {
return param(element); return param(element);
} }
}, },
optional: function(element) { optional: function(element) {
return !$.validator.methods.required.call(this, $.trim(element.value), element) && "dependency-mismatch"; return !$.validator.methods.required.call(this, $.trim(element.value), element) && "dependency-mismatch";
}, },
startRequest: function(element) { startRequest: function(element) {
if (!this.pending[element.name]) { if (!this.pending[element.name]) {
this.pendingRequest++; this.pendingRequest++;
this.pending[element.name] = true; this.pending[element.name] = true;
} }
}, },
stopRequest: function(element, valid) { stopRequest: function(element, valid) {
this.pendingRequest--; this.pendingRequest--;
// sometimes synchronization fails, make sure pendingRequest is never < 0 // sometimes synchronization fails, make sure pendingRequest is never < 0
@ -842,7 +842,7 @@ $.extend($.validator, {
this.formSubmitted = false; this.formSubmitted = false;
} }
}, },
previousValue: function(element) { previousValue: function(element) {
return $.data(element, "previousValue") || $.data(element, "previousValue", { return $.data(element, "previousValue") || $.data(element, "previousValue", {
old: null, old: null,
@ -850,9 +850,9 @@ $.extend($.validator, {
message: this.defaultMessage( element, "remote" ) message: this.defaultMessage( element, "remote" )
}); });
} }
}, },
classRuleSettings: { classRuleSettings: {
required: {required: true}, required: {required: true},
email: {email: true}, email: {email: true},
@ -865,7 +865,7 @@ $.extend($.validator, {
digits: {digits: true}, digits: {digits: true},
creditcard: {creditcard: true} creditcard: {creditcard: true}
}, },
addClassRules: function(className, rules) { addClassRules: function(className, rules) {
/// <summary> /// <summary>
/// Add a compound class method - useful to refactor common combinations of rules into a single /// Add a compound class method - useful to refactor common combinations of rules into a single
@ -882,7 +882,7 @@ $.extend($.validator, {
this.classRuleSettings[className] = rules : this.classRuleSettings[className] = rules :
$.extend(this.classRuleSettings, className); $.extend(this.classRuleSettings, className);
}, },
classRules: function(element) { classRules: function(element) {
var rules = {}; var rules = {};
var classes = $(element).attr('class'); var classes = $(element).attr('class');
@ -893,7 +893,7 @@ $.extend($.validator, {
}); });
return rules; return rules;
}, },
attributeRules: function(element) { attributeRules: function(element) {
var rules = {}; var rules = {};
var $element = $(element); var $element = $(element);
@ -904,24 +904,24 @@ $.extend($.validator, {
rules[method] = value; rules[method] = value;
} }
} }
// maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs // maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs
if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) { if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) {
delete rules.maxlength; delete rules.maxlength;
} }
return rules; return rules;
}, },
metadataRules: function(element) { metadataRules: function(element) {
if (!$.metadata) return {}; if (!$.metadata) return {};
var meta = $.data(element.form, 'validator').settings.meta; var meta = $.data(element.form, 'validator').settings.meta;
return meta ? return meta ?
$(element).metadata()[meta] : $(element).metadata()[meta] :
$(element).metadata(); $(element).metadata();
}, },
staticRules: function(element) { staticRules: function(element) {
var rules = {}; var rules = {};
var validator = $.data(element.form, 'validator'); var validator = $.data(element.form, 'validator');
@ -930,7 +930,7 @@ $.extend($.validator, {
} }
return rules; return rules;
}, },
normalizeRules: function(rules, element) { normalizeRules: function(rules, element) {
// handle dependency check // handle dependency check
$.each(rules, function(prop, val) { $.each(rules, function(prop, val) {
@ -956,12 +956,12 @@ $.extend($.validator, {
} }
} }
}); });
// evaluate parameters // evaluate parameters
$.each(rules, function(rule, parameter) { $.each(rules, function(rule, parameter) {
rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter; rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter;
}); });
// clean number parameters // clean number parameters
$.each(['minlength', 'maxlength', 'min', 'max'], function() { $.each(['minlength', 'maxlength', 'min', 'max'], function() {
if (rules[this]) { if (rules[this]) {
@ -973,7 +973,7 @@ $.extend($.validator, {
rules[this] = [Number(rules[this][0]), Number(rules[this][1])]; rules[this] = [Number(rules[this][0]), Number(rules[this][1])];
} }
}); });
if ($.validator.autoCreateRanges) { if ($.validator.autoCreateRanges) {
// auto-create ranges // auto-create ranges
if (rules.min && rules.max) { if (rules.min && rules.max) {
@ -987,15 +987,15 @@ $.extend($.validator, {
delete rules.maxlength; delete rules.maxlength;
} }
} }
// To support custom messages in metadata ignore rule methods titled "messages" // To support custom messages in metadata ignore rule methods titled "messages"
if (rules.messages) { if (rules.messages) {
delete rules.messages; delete rules.messages;
} }
return rules; return rules;
}, },
// Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true}
normalizeRule: function(data) { normalizeRule: function(data) {
if( typeof data == "string" ) { if( typeof data == "string" ) {
@ -1007,11 +1007,11 @@ $.extend($.validator, {
} }
return data; return data;
}, },
// http://docs.jquery.com/Plugins/Validation/Validator/addMethod // http://docs.jquery.com/Plugins/Validation/Validator/addMethod
addMethod: function(name, method, message) { addMethod: function(name, method, message) {
/// <summary> /// <summary>
/// Add a custom validation method. It must consist of a name (must be a legal javascript /// Add a custom validation method. It must consist of a name (must be a legal javascript
/// identifier), a javascript based function and a default string message. /// identifier), a javascript based function and a default string message.
/// </summary> /// </summary>
/// <param name="name" type="String"> /// <param name="name" type="String">
@ -1022,8 +1022,8 @@ $.extend($.validator, {
/// The actual method implementation, returning true if an element is valid /// The actual method implementation, returning true if an element is valid
/// </param> /// </param>
/// <param name="message" type="String" optional="true"> /// <param name="message" type="String" optional="true">
/// (Optional) The default message to display for this method. Can be a function created by /// (Optional) The default message to display for this method. Can be a function created by
/// jQuery.validator.format(value). When undefined, an already existing message is used /// jQuery.validator.format(value). When undefined, an already existing message is used
/// (handy for localization), otherwise the field-specific messages have to be defined. /// (handy for localization), otherwise the field-specific messages have to be defined.
/// </param> /// </param>
@ -1053,20 +1053,20 @@ $.extend($.validator, {
return $.trim(value).length > 0; return $.trim(value).length > 0;
} }
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/remote // http://docs.jquery.com/Plugins/Validation/Methods/remote
remote: function(value, element, param) { remote: function(value, element, param) {
if ( this.optional(element) ) if ( this.optional(element) )
return "dependency-mismatch"; return "dependency-mismatch";
var previous = this.previousValue(element); var previous = this.previousValue(element);
if (!this.settings.messages[element.name] ) if (!this.settings.messages[element.name] )
this.settings.messages[element.name] = {}; this.settings.messages[element.name] = {};
previous.originalMessage = this.settings.messages[element.name].remote; previous.originalMessage = this.settings.messages[element.name].remote;
this.settings.messages[element.name].remote = previous.message; this.settings.messages[element.name].remote = previous.message;
param = typeof param == "string" && {url:param} || param; param = typeof param == "string" && {url:param} || param;
if ( this.pending[element.name] ) { if ( this.pending[element.name] ) {
return "pending"; return "pending";
} }
@ -1111,65 +1111,65 @@ $.extend($.validator, {
minlength: function(value, element, param) { minlength: function(value, element, param) {
return this.optional(element) || this.getLength($.trim(value), element) >= param; return this.optional(element) || this.getLength($.trim(value), element) >= param;
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/maxlength // http://docs.jquery.com/Plugins/Validation/Methods/maxlength
maxlength: function(value, element, param) { maxlength: function(value, element, param) {
return this.optional(element) || this.getLength($.trim(value), element) <= param; return this.optional(element) || this.getLength($.trim(value), element) <= param;
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/rangelength // http://docs.jquery.com/Plugins/Validation/Methods/rangelength
rangelength: function(value, element, param) { rangelength: function(value, element, param) {
var length = this.getLength($.trim(value), element); var length = this.getLength($.trim(value), element);
return this.optional(element) || ( length >= param[0] && length <= param[1] ); return this.optional(element) || ( length >= param[0] && length <= param[1] );
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/min // http://docs.jquery.com/Plugins/Validation/Methods/min
min: function( value, element, param ) { min: function( value, element, param ) {
return this.optional(element) || value >= param; return this.optional(element) || value >= param;
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/max // http://docs.jquery.com/Plugins/Validation/Methods/max
max: function( value, element, param ) { max: function( value, element, param ) {
return this.optional(element) || value <= param; return this.optional(element) || value <= param;
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/range // http://docs.jquery.com/Plugins/Validation/Methods/range
range: function( value, element, param ) { range: function( value, element, param ) {
return this.optional(element) || ( value >= param[0] && value <= param[1] ); return this.optional(element) || ( value >= param[0] && value <= param[1] );
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/email // http://docs.jquery.com/Plugins/Validation/Methods/email
email: function(value, element) { email: function(value, element) {
// contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/ // contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value); return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/url // http://docs.jquery.com/Plugins/Validation/Methods/url
url: function(value, element) { url: function(value, element) {
// contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/ // contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/
return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/date // http://docs.jquery.com/Plugins/Validation/Methods/date
date: function(value, element) { date: function(value, element) {
return this.optional(element) || !/Invalid|NaN/.test(new Date(value)); return this.optional(element) || !/Invalid|NaN/.test(new Date(value));
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/dateISO // http://docs.jquery.com/Plugins/Validation/Methods/dateISO
dateISO: function(value, element) { dateISO: function(value, element) {
return this.optional(element) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value); return this.optional(element) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/number // http://docs.jquery.com/Plugins/Validation/Methods/number
number: function(value, element) { number: function(value, element) {
return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value); return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/digits // http://docs.jquery.com/Plugins/Validation/Methods/digits
digits: function(value, element) { digits: function(value, element) {
return this.optional(element) || /^\d+$/.test(value); return this.optional(element) || /^\d+$/.test(value);
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/creditcard // http://docs.jquery.com/Plugins/Validation/Methods/creditcard
// based on http://en.wikipedia.org/wiki/Luhn // based on http://en.wikipedia.org/wiki/Luhn
creditcard: function(value, element) { creditcard: function(value, element) {
@ -1197,13 +1197,13 @@ $.extend($.validator, {
return (nCheck % 10) == 0; return (nCheck % 10) == 0;
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/accept // http://docs.jquery.com/Plugins/Validation/Methods/accept
accept: function(value, element, param) { accept: function(value, element, param) {
param = typeof param == "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif"; param = typeof param == "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif";
return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i")); return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i"));
}, },
// http://docs.jquery.com/Plugins/Validation/Methods/equalTo // http://docs.jquery.com/Plugins/Validation/Methods/equalTo
equalTo: function(value, element, param) { equalTo: function(value, element, param) {
// bind to the blur event of the target in order to revalidate whenever the target field is updated // bind to the blur event of the target in order to revalidate whenever the target field is updated
@ -1213,9 +1213,9 @@ $.extend($.validator, {
}); });
return value == target.val(); return value == target.val();
} }
} }
}); });
// deprecated, use $.validator.format instead // deprecated, use $.validator.format instead
@ -1225,7 +1225,7 @@ $.format = $.validator.format;
// ajax mode: abort // ajax mode: abort
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); // usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() // if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
;(function($) { ;(function($) {
var pendingRequests = {}; var pendingRequests = {};
// Use a prefilter if available (1.5+) // Use a prefilter if available (1.5+)
@ -1260,14 +1260,14 @@ $.format = $.validator.format;
// IE has native support, in other browsers, use event caputuring (neither bubbles) // IE has native support, in other browsers, use event caputuring (neither bubbles)
// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation // provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation
// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target // handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target
;(function($) { ;(function($) {
// only implement if not provided by jQuery core (since 1.4) // only implement if not provided by jQuery core (since 1.4)
// TODO verify if jQuery 1.4's implementation is compatible with older jQuery special-event APIs // TODO verify if jQuery 1.4's implementation is compatible with older jQuery special-event APIs
if (!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener) { if (!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener) {
$.each({ $.each({
focus: 'focusin', focus: 'focusin',
blur: 'focusout' blur: 'focusout'
}, function( original, fix ){ }, function( original, fix ){
$.event.special[fix] = { $.event.special[fix] = {
setup:function() { setup:function() {

View File

@ -122,7 +122,7 @@ $.extend($.fn, {
return valid; return valid;
} }
}, },
// attributes: space seperated list of attributes to retrieve and remove // attributes: space separated list of attributes to retrieve and remove
removeAttrs: function( attributes ) { removeAttrs: function( attributes ) {
var result = {}, var result = {},
$element = this; $element = this;

View File

@ -6,12 +6,12 @@ using System;
namespace Microsoft.AspNetCore.Mvc.ModelBinding namespace Microsoft.AspNetCore.Mvc.ModelBinding
{ {
/// <summary> /// <summary>
/// An error that occured during model binding and validation. /// An error that occurred during model binding and validation.
/// </summary> /// </summary>
public class ModelError public class ModelError
{ {
/// <summary> /// <summary>
/// Intiializes a new instance of <see cref="ModelError"/> with the specified <paramref name="exception"/>. /// Initializes a new instance of <see cref="ModelError"/> with the specified <paramref name="exception"/>.
/// </summary> /// </summary>
/// <param name="exception">The <see cref="System.Exception"/>.</param> /// <param name="exception">The <see cref="System.Exception"/>.</param>
public ModelError(Exception exception) public ModelError(Exception exception)
@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
} }
/// <summary> /// <summary>
/// Intiializes a new instance of <see cref="ModelError"/> with the specified <paramref name="exception"/> /// Initializes a new instance of <see cref="ModelError"/> with the specified <paramref name="exception"/>
/// and specified <paramref name="errorMessage"/>. /// and specified <paramref name="errorMessage"/>.
/// </summary> /// </summary>
/// <param name="exception">The <see cref="System.Exception"/>.</param> /// <param name="exception">The <see cref="System.Exception"/>.</param>

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
@ -511,7 +511,7 @@
<value>Unexcepted end when reading JSON.</value> <value>Unexcepted end when reading JSON.</value>
</data> </data>
<data name="ApiConventions_Title_500" xml:space="preserve"> <data name="ApiConventions_Title_500" xml:space="preserve">
<value>An error occured while processing your request.</value> <value>An error occurred while processing your request.</value>
</data> </data>
<data name="FailedToReadRequestForm" xml:space="preserve"> <data name="FailedToReadRequestForm" xml:space="preserve">
<value>Failed to read the request form. {0}</value> <value>Failed to read the request form. {0}</value>

View File

@ -2416,7 +2416,7 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test
var problemDetails = Assert.IsType<ProblemDetails>(badRequestResult.Value); var problemDetails = Assert.IsType<ProblemDetails>(badRequestResult.Value);
Assert.Equal(500, actionResult.StatusCode); Assert.Equal(500, actionResult.StatusCode);
Assert.Equal(500, problemDetails.Status); Assert.Equal(500, problemDetails.Status);
Assert.Equal("An error occured while processing your request.", problemDetails.Title); Assert.Equal("An error occurred while processing your request.", problemDetails.Title);
Assert.Equal("https://tools.ietf.org/html/rfc7231#section-6.6.1", problemDetails.Type); Assert.Equal("https://tools.ietf.org/html/rfc7231#section-6.6.1", problemDetails.Type);
Assert.Equal("some-trace", problemDetails.Extensions["traceId"]); Assert.Equal("some-trace", problemDetails.Extensions["traceId"]);
} }
@ -2488,7 +2488,7 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test
}, },
[500] = new ClientErrorData [500] = new ClientErrorData
{ {
Title = "An error occured while processing your request.", Title = "An error occurred while processing your request.",
Link = "https://tools.ietf.org/html/rfc7231#section-6.6.1" Link = "https://tools.ietf.org/html/rfc7231#section-6.6.1"
} }
} }

View File

@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
// Assert // Assert
Assert.Equal(500, problemDetails.Status); Assert.Equal(500, problemDetails.Status);
Assert.Equal("An error occured while processing your request.", problemDetails.Title); Assert.Equal("An error occurred while processing your request.", problemDetails.Title);
Assert.Equal("https://tools.ietf.org/html/rfc7231#section-6.6.1", problemDetails.Type); Assert.Equal("https://tools.ietf.org/html/rfc7231#section-6.6.1", problemDetails.Type);
Assert.Null(problemDetails.Instance); Assert.Null(problemDetails.Instance);
Assert.Null(problemDetails.Detail); Assert.Null(problemDetails.Detail);

View File

@ -101,7 +101,7 @@ export class LoginComponent implements OnInit {
private getReturnUrl(state?: INavigationState): string { private getReturnUrl(state?: INavigationState): string {
const fromQuery = (this.activatedRoute.snapshot.queryParams as INavigationState).returnUrl; const fromQuery = (this.activatedRoute.snapshot.queryParams as INavigationState).returnUrl;
// If the url is comming from the query string, check that is either // If the url is coming from the query string, check that is either
// a relative url or an absolute url // a relative url or an absolute url
if (fromQuery && if (fromQuery &&
!(fromQuery.startsWith(`${window.location.origin}/`) || !(fromQuery.startsWith(`${window.location.origin}/`) ||

View File

@ -95,7 +95,7 @@ export class LogoutComponent implements OnInit {
private getReturnUrl(state?: INavigationState): string { private getReturnUrl(state?: INavigationState): string {
const fromQuery = (this.activatedRoute.snapshot.queryParams as INavigationState).returnUrl; const fromQuery = (this.activatedRoute.snapshot.queryParams as INavigationState).returnUrl;
// If the url is comming from the query string, check that is either // If the url is coming from the query string, check that is either
// a relative url or an absolute url // a relative url or an absolute url
if (fromQuery && if (fromQuery &&
!(fromQuery.startsWith(`${window.location.origin}/`) || !(fromQuery.startsWith(`${window.location.origin}/`) ||

View File

@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Authentication.Negotiate
: base(context, scheme, options, properties: null) { } : base(context, scheme, options, properties: null) { }
/// <summary> /// <summary>
/// The exception that occured while processing the authentication. /// The exception that occurred while processing the authentication.
/// </summary> /// </summary>
public Exception Exception { get; set; } public Exception Exception { get; set; }
} }

View File

@ -123,7 +123,7 @@ namespace Microsoft.AspNetCore.Authentication.Negotiate
errorCode = SecurityStatusPalErrorCode.UnknownCredentials; errorCode = SecurityStatusPalErrorCode.UnknownCredentials;
} }
error = new Exception($"An authentication exception occured (0x{majorStatus:X}/0x{minorStatus:X}).", error); error = new Exception($"An authentication exception occurred (0x{majorStatus:X}/0x{minorStatus:X}).", error);
} }
if (errorCode == SecurityStatusPalErrorCode.OK if (errorCode == SecurityStatusPalErrorCode.OK

View File

@ -131,7 +131,7 @@ namespace Microsoft.AspNetCore.Authentication.Negotiate
{ {
eventInvoked++; eventInvoked++;
Assert.IsType<Exception>(context.Exception); Assert.IsType<Exception>(context.Exception);
Assert.Equal("A test other error occured", context.Exception.Message); Assert.Equal("A test other error occurred", context.Exception.Message);
return Task.CompletedTask; return Task.CompletedTask;
} }
}; };
@ -140,7 +140,7 @@ namespace Microsoft.AspNetCore.Authentication.Negotiate
var ex = await Assert.ThrowsAsync<Exception>(() => var ex = await Assert.ThrowsAsync<Exception>(() =>
SendAsync(server, "/404", new TestConnection(), "Negotiate OtherError")); SendAsync(server, "/404", new TestConnection(), "Negotiate OtherError"));
Assert.Equal("A test other error occured", ex.Message); Assert.Equal("A test other error occurred", ex.Message);
Assert.Equal(1, eventInvoked); Assert.Equal(1, eventInvoked);
} }
@ -182,7 +182,7 @@ namespace Microsoft.AspNetCore.Authentication.Negotiate
{ {
eventInvoked++; eventInvoked++;
Assert.IsType<Exception>(context.Exception); Assert.IsType<Exception>(context.Exception);
Assert.Equal("A test credential error occured", context.Exception.Message); Assert.Equal("A test credential error occurred", context.Exception.Message);
return Task.CompletedTask; return Task.CompletedTask;
} }
}; };
@ -232,7 +232,7 @@ namespace Microsoft.AspNetCore.Authentication.Negotiate
{ {
eventInvoked++; eventInvoked++;
Assert.IsType<Exception>(context.Exception); Assert.IsType<Exception>(context.Exception);
Assert.Equal("A test client error occured", context.Exception.Message); Assert.Equal("A test client error occurred", context.Exception.Message);
return Task.CompletedTask; return Task.CompletedTask;
} }
}; };
@ -555,15 +555,15 @@ namespace Microsoft.AspNetCore.Authentication.Negotiate
return "ServerKerberosBlob2"; return "ServerKerberosBlob2";
case "CredentialError": case "CredentialError":
errorType = BlobErrorType.CredentialError; errorType = BlobErrorType.CredentialError;
ex = new Exception("A test credential error occured"); ex = new Exception("A test credential error occurred");
return null; return null;
case "ClientError": case "ClientError":
errorType = BlobErrorType.ClientError; errorType = BlobErrorType.ClientError;
ex = new Exception("A test client error occured"); ex = new Exception("A test client error occurred");
return null; return null;
case "OtherError": case "OtherError":
errorType = BlobErrorType.Other; errorType = BlobErrorType.Other;
ex = new Exception("A test other error occured"); ex = new Exception("A test other error occurred");
return null; return null;
default: default:
errorType = BlobErrorType.Other; errorType = BlobErrorType.Other;

View File

@ -301,7 +301,7 @@ namespace Microsoft.AspNetCore.Authentication.Negotiate
var testConnection = new TestConnection(); var testConnection = new TestConnection();
var ex = await Assert.ThrowsAsync<Exception>(() => SendAsync(server, "/404", testConnection, "Negotiate OtherError")); var ex = await Assert.ThrowsAsync<Exception>(() => SendAsync(server, "/404", testConnection, "Negotiate OtherError"));
Assert.Equal("A test other error occured", ex.Message); Assert.Equal("A test other error occurred", ex.Message);
} }
// Single Stage // Single Stage
@ -552,15 +552,15 @@ namespace Microsoft.AspNetCore.Authentication.Negotiate
return "ServerKerberosBlob2"; return "ServerKerberosBlob2";
case "CredentialError": case "CredentialError":
errorType = BlobErrorType.CredentialError; errorType = BlobErrorType.CredentialError;
ex = new Exception("A test credential error occured"); ex = new Exception("A test credential error occurred");
return null; return null;
case "ClientError": case "ClientError":
errorType = BlobErrorType.ClientError; errorType = BlobErrorType.ClientError;
ex = new Exception("A test client error occured"); ex = new Exception("A test client error occurred");
return null; return null;
case "OtherError": case "OtherError":
errorType = BlobErrorType.Other; errorType = BlobErrorType.Other;
ex = new Exception("A test other error occured"); ex = new Exception("A test other error occurred");
return null; return null;
default: default:
errorType = BlobErrorType.Other; errorType = BlobErrorType.Other;

View File

@ -148,7 +148,7 @@ namespace OpenIdConnect.AzureAdSample
} }
catch (Exception ex) catch (Exception ex)
{ {
await response.WriteAsync($"AquireToken error: {ex.Message}"); await response.WriteAsync($"AcquireToken error: {ex.Message}");
} }
}); });
} }

View File

@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
new CertificateAuthenticationOptions new CertificateAuthenticationOptions
{ {
AllowedCertificateTypes = CertificateTypes.SelfSigned, AllowedCertificateTypes = CertificateTypes.SelfSigned,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
Certificates.SelfSignedValidWithClientEku); Certificates.SelfSignedValidWithClientEku);
@ -63,7 +63,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
new CertificateAuthenticationOptions new CertificateAuthenticationOptions
{ {
AllowedCertificateTypes = CertificateTypes.SelfSigned, AllowedCertificateTypes = CertificateTypes.SelfSigned,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
Certificates.SelfSignedValidWithNoEku); Certificates.SelfSignedValidWithNoEku);
@ -92,7 +92,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
new CertificateAuthenticationOptions new CertificateAuthenticationOptions
{ {
AllowedCertificateTypes = CertificateTypes.Chained, AllowedCertificateTypes = CertificateTypes.Chained,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
Certificates.SelfSignedValidWithNoEku); Certificates.SelfSignedValidWithNoEku);
@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
new CertificateAuthenticationOptions new CertificateAuthenticationOptions
{ {
AllowedCertificateTypes = CertificateTypes.SelfSigned, AllowedCertificateTypes = CertificateTypes.SelfSigned,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
Certificates.SelfSignedValidWithServerEku); Certificates.SelfSignedValidWithServerEku);
@ -123,7 +123,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
{ {
AllowedCertificateTypes = CertificateTypes.SelfSigned, AllowedCertificateTypes = CertificateTypes.SelfSigned,
ValidateCertificateUse = false, ValidateCertificateUse = false,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
Certificates.SelfSignedValidWithServerEku); Certificates.SelfSignedValidWithServerEku);
@ -139,7 +139,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
{ {
AllowedCertificateTypes = CertificateTypes.Chained, AllowedCertificateTypes = CertificateTypes.Chained,
ValidateCertificateUse = false, ValidateCertificateUse = false,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
Certificates.SelfSignedValidWithServerEku); Certificates.SelfSignedValidWithServerEku);
@ -155,7 +155,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
{ {
AllowedCertificateTypes = CertificateTypes.SelfSigned, AllowedCertificateTypes = CertificateTypes.SelfSigned,
ValidateCertificateUse = false, ValidateCertificateUse = false,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
Certificates.SelfSignedExpired); Certificates.SelfSignedExpired);
@ -171,7 +171,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
{ {
AllowedCertificateTypes = CertificateTypes.SelfSigned, AllowedCertificateTypes = CertificateTypes.SelfSigned,
ValidateValidityPeriod = false, ValidateValidityPeriod = false,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
Certificates.SelfSignedExpired); Certificates.SelfSignedExpired);
@ -187,7 +187,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
{ {
AllowedCertificateTypes = CertificateTypes.SelfSigned, AllowedCertificateTypes = CertificateTypes.SelfSigned,
ValidateCertificateUse = false, ValidateCertificateUse = false,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
Certificates.SelfSignedNotYetValid); Certificates.SelfSignedNotYetValid);
@ -203,7 +203,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
{ {
AllowedCertificateTypes = CertificateTypes.SelfSigned, AllowedCertificateTypes = CertificateTypes.SelfSigned,
ValidateValidityPeriod = false, ValidateValidityPeriod = false,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
Certificates.SelfSignedNotYetValid); Certificates.SelfSignedNotYetValid);
@ -248,7 +248,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
var server = CreateServer( var server = CreateServer(
new CertificateAuthenticationOptions new CertificateAuthenticationOptions
{ {
Events = sucessfulValidationEvents Events = successfulValidationEvents
}); });
var response = await server.CreateClient().GetAsync("https://example.com/"); var response = await server.CreateClient().GetAsync("https://example.com/");
@ -262,9 +262,9 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
new CertificateAuthenticationOptions new CertificateAuthenticationOptions
{ {
AllowedCertificateTypes = CertificateTypes.SelfSigned, AllowedCertificateTypes = CertificateTypes.SelfSigned,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
wireUpHeaderMiddleware : true); wireUpHeaderMiddleware: true);
var client = server.CreateClient(); var client = server.CreateClient();
client.DefaultRequestHeaders.Add("X-Client-Cert", Convert.ToBase64String(Certificates.SelfSignedValidWithNoEku.RawData)); client.DefaultRequestHeaders.Add("X-Client-Cert", Convert.ToBase64String(Certificates.SelfSignedValidWithNoEku.RawData));
@ -278,7 +278,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
var server = CreateServer( var server = CreateServer(
new CertificateAuthenticationOptions new CertificateAuthenticationOptions
{ {
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
wireUpHeaderMiddleware: true); wireUpHeaderMiddleware: true);
@ -295,7 +295,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
new CertificateAuthenticationOptions new CertificateAuthenticationOptions
{ {
AllowedCertificateTypes = CertificateTypes.SelfSigned, AllowedCertificateTypes = CertificateTypes.SelfSigned,
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
wireUpHeaderMiddleware: true, wireUpHeaderMiddleware: true,
headerName: "X-ARR-ClientCert"); headerName: "X-ARR-ClientCert");
@ -312,7 +312,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
var server = CreateServer( var server = CreateServer(
new CertificateAuthenticationOptions new CertificateAuthenticationOptions
{ {
Events = sucessfulValidationEvents Events = successfulValidationEvents
}, },
wireUpHeaderMiddleware: true, wireUpHeaderMiddleware: true,
headerName: "X-ARR-ClientCert"); headerName: "X-ARR-ClientCert");
@ -564,7 +564,7 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test
return server; return server;
} }
private CertificateAuthenticationEvents sucessfulValidationEvents = new CertificateAuthenticationEvents() private CertificateAuthenticationEvents successfulValidationEvents = new CertificateAuthenticationEvents()
{ {
OnCertificateValidated = context => OnCertificateValidated = context =>
{ {

View File

@ -148,6 +148,6 @@
<value>The given IAsyncResult does not match this opperation.</value> <value>The given IAsyncResult does not match this opperation.</value>
</data> </data>
<data name="Warning_ExceptionInOnResponseCompletedAction" xml:space="preserve"> <data name="Warning_ExceptionInOnResponseCompletedAction" xml:space="preserve">
<value>An exception occured while running an action registered with {0}.</value> <value>An exception occurred while running an action registered with {0}.</value>
</data> </data>
</root> </root>

View File

@ -266,7 +266,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
[ConditionalFact] [ConditionalFact]
[MinimumOSVersion(OperatingSystems.Windows, "10.0.19529", SkipReason = "Requires HTTP/2 Trailers support.")] [MinimumOSVersion(OperatingSystems.Windows, "10.0.19529", SkipReason = "Requires HTTP/2 Trailers support.")]
public async Task ResponseTrailers_MultipleValues_SentAsSeperateHeaders() public async Task ResponseTrailers_MultipleValues_SentAsSeparateHeaders()
{ {
using (Utilities.CreateDynamicHttpsServer(out var address, httpContext => using (Utilities.CreateDynamicHttpsServer(out var address, httpContext =>
{ {
@ -278,7 +278,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
Assert.Equal(HttpVersion.Version20, response.Version); Assert.Equal(HttpVersion.Version20, response.Version);
Assert.NotEmpty(response.TrailingHeaders); Assert.NotEmpty(response.TrailingHeaders);
// We can't actually assert they are sent as seperate headers using HttpClient, we'd have to write a lower level test // We can't actually assert they are sent as separate headers using HttpClient, we'd have to write a lower level test
// that read the header frames directly. // that read the header frames directly.
Assert.Equal(new[] { "TrailerValue0", "TrailerValue1" }, response.TrailingHeaders.GetValues("TrailerName")); Assert.Equal(new[] { "TrailerValue0", "TrailerValue1" }, response.TrailingHeaders.GetValues("TrailerName"));
} }

View File

@ -9,7 +9,7 @@ class ConfigurationLoadException: public std::runtime_error
{ {
public: public:
ConfigurationLoadException(std::wstring msg) ConfigurationLoadException(std::wstring msg)
: runtime_error("Configuration load exception has occured"), message(std::move(msg)) : runtime_error("Configuration load exception has occurred"), message(std::move(msg))
{ {
} }

View File

@ -406,7 +406,7 @@ HASH_TABLE<_Record,_Key>::InsertRecord(
) )
/*++ /*++
This method inserts a node for this record and also empty nodes for paths This method inserts a node for this record and also empty nodes for paths
in the heirarchy leading upto this path in the hierarchy leading upto this path
The insert is done under only a read-lock - this is possible by keeping The insert is done under only a read-lock - this is possible by keeping
the hashes in a bucket in increasing order and using interlocked operations the hashes in a bucket in increasing order and using interlocked operations

View File

@ -82,7 +82,7 @@ private:
); );
// //
// Pointer to the begining of the inlined array. // Pointer to the beginning of the inlined array.
// //
PVOID m_pVariables; PVOID m_pVariables;
SIZE_T m_Alignment; SIZE_T m_Alignment;
@ -104,7 +104,7 @@ PER_CPU<T>::Create(
DWORD ObjectCacheLineSize = 0; DWORD ObjectCacheLineSize = 0;
DWORD NumberOfProcessors = 0; DWORD NumberOfProcessors = 0;
PER_CPU<T> * pInstance = NULL; PER_CPU<T> * pInstance = NULL;
hr = GetProcessorInformation(&CacheLineSize, hr = GetProcessorInformation(&CacheLineSize,
&NumberOfProcessors); &NumberOfProcessors);
if (FAILED(hr)) if (FAILED(hr))
@ -143,7 +143,7 @@ PER_CPU<T>::Create(
// The array start in the 2nd cache line. // The array start in the 2nd cache line.
// //
pInstance->m_pVariables = reinterpret_cast<PBYTE>(pInstance) + CacheLineSize; pInstance->m_pVariables = reinterpret_cast<PBYTE>(pInstance) + CacheLineSize;
// //
// Pass a disposer for disposing initialized items in case of failure. // Pass a disposer for disposing initialized items in case of failure.
// //

View File

@ -1637,7 +1637,7 @@ Arguments:
Return Value: Return Value:
The index for the first character occurence in the string. The index for the first character occurrence in the string.
-1 if not found. -1 if not found.
@ -1684,7 +1684,7 @@ Arguments:
Return Value: Return Value:
The index for the first character occurence in the string. The index for the first character occurrence in the string.
-1 if not found. -1 if not found.
@ -1733,7 +1733,7 @@ Arguments:
Return Value: Return Value:
The index for the last character occurence in the string. The index for the last character occurrence in the string.
-1 if not found. -1 if not found.

View File

@ -1065,7 +1065,7 @@ Arguments:
Return Value: Return Value:
The index for the first character occurence in the string. The index for the first character occurrence in the string.
-1 if not found. -1 if not found.
@ -1112,7 +1112,7 @@ Arguments:
Return Value: Return Value:
The index for the first character occurence in the string. The index for the first character occurrence in the string.
-1 if not found. -1 if not found.
@ -1161,7 +1161,7 @@ Arguments:
Return Value: Return Value:
The index for the last character occurence in the string. The index for the last character occurrence in the string.
-1 if not found. -1 if not found.

View File

@ -417,7 +417,7 @@ TREE_HASH_TABLE<_Record>::AddNodeInternal(
TREE_HASH_NODE<_Record> ** ppNewNode TREE_HASH_NODE<_Record> ** ppNewNode
) )
/*++ /*++
Return value is HRESULT indicating sucess or failure Return value is HRESULT indicating success or failure
pszPath, dwHash, pRecord - path, hash value and record to be inserted pszPath, dwHash, pRecord - path, hash value and record to be inserted
pParentNode - this will be the parent of the node being inserted pParentNode - this will be the parent of the node being inserted
ppNewNode - on successful return, the new node created and inserted ppNewNode - on successful return, the new node created and inserted
@ -519,7 +519,7 @@ TREE_HASH_TABLE<_Record>::InsertRecord(
) )
/*++ /*++
This method inserts a node for this record and also empty nodes for paths This method inserts a node for this record and also empty nodes for paths
in the heirarchy leading upto this path in the hierarchy leading upto this path
The insert is done under only a read-lock - this is possible by keeping The insert is done under only a read-lock - this is possible by keeping
the hashes in a bucket in increasing order and using interlocked operations the hashes in a bucket in increasing order and using interlocked operations

View File

@ -195,7 +195,7 @@ IN_PROCESS_APPLICATION::ExecuteApplication()
auto context = std::make_shared<ExecuteClrContext>(); auto context = std::make_shared<ExecuteClrContext>();
ErrorContext errorContext; // unused ErrorContext errorContext; // unused
if (s_fMainCallback == nullptr) if (s_fMainCallback == nullptr)
{ {
@ -247,15 +247,15 @@ IN_PROCESS_APPLICATION::ExecuteApplication()
auto startupReturnCode = context->m_hostFxr.InitializeForApp(context->m_argc, context->m_argv.get(), m_dotnetExeKnownLocation); auto startupReturnCode = context->m_hostFxr.InitializeForApp(context->m_argc, context->m_argv.get(), m_dotnetExeKnownLocation);
if (startupReturnCode != 0) if (startupReturnCode != 0)
{ {
throw InvalidOperationException(format(L"Error occured when initializing inprocess application, Return code: 0x%x", startupReturnCode)); throw InvalidOperationException(format(L"Error occurred when initializing in-process application, Return code: 0x%x", startupReturnCode));
} }
if (m_pConfig->QueryCallStartupHook()) if (m_pConfig->QueryCallStartupHook())
{ {
PWSTR startupHookValue = NULL; PWSTR startupHookValue = NULL;
// Will get property not found if the enviroment variable isn't set. // Will get property not found if the environment variable isn't set.
context->m_hostFxr.GetRuntimePropertyValue(DOTNETCORE_STARTUP_HOOK, &startupHookValue); context->m_hostFxr.GetRuntimePropertyValue(DOTNETCORE_STARTUP_HOOK, &startupHookValue);
if (startupHookValue == NULL) if (startupHookValue == NULL)
{ {
RETURN_IF_NOT_ZERO(context->m_hostFxr.SetRuntimePropertyValue(DOTNETCORE_STARTUP_HOOK, ASPNETCORE_STARTUP_ASSEMBLY)); RETURN_IF_NOT_ZERO(context->m_hostFxr.SetRuntimePropertyValue(DOTNETCORE_STARTUP_HOOK, ASPNETCORE_STARTUP_ASSEMBLY));

View File

@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
for (shift = total; shift >= 0; shift -= 4) for (shift = total; shift >= 0; shift -= 4)
{ {
// Using Unsafe.Add to elide the bounds check on _hex as the & 0x0f definately // Using Unsafe.Add to elide the bounds check on _hex as the & 0x0f definitely
// constrains it to the range 0x0 - 0xf, matching the bounds of the array // constrains it to the range 0x0 - 0xf, matching the bounds of the array
span[offset] = Unsafe.Add(ref startHex, ((dataCount >> shift) & 0x0f)); span[offset] = Unsafe.Add(ref startHex, ((dataCount >> shift) & 0x0f));
offset++; offset++;
@ -56,7 +56,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
// bytes for the chunked prefix, so we would have to copy once we call advance. Therefore, to avoid this scenario, // bytes for the chunked prefix, so we would have to copy once we call advance. Therefore, to avoid this scenario,
// we slice the memory by one byte. // we slice the memory by one byte.
// See https://gist.github.com/halter73/af2b9f78978f83813b19e187c4e5309e if you would like to tweek the algorithm at all. // See https://gist.github.com/halter73/af2b9f78978f83813b19e187c4e5309e if you would like to tweak the algorithm at all.
if (length <= 65544) if (length <= 65544)
{ {

View File

@ -241,7 +241,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
TakeSingleHeader(pHeader, length, handler); TakeSingleHeader(pHeader, length, handler);
} }
// Read the header sucessfully, skip the reader forward past the header line. // Read the header successfully, skip the reader forward past the header line.
reader.Advance(length); reader.Advance(length);
span = span.Slice(length); span = span.Slice(length);
} }

View File

@ -197,7 +197,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
var result = await Input.ReadAsync(); var result = await Input.ReadAsync();
var buffer = result.Buffer; var buffer = result.Buffer;
// Call UpdateCompletedStreams() prior to frame processing in order to remove any streams that have exceded their drain timeouts. // Call UpdateCompletedStreams() prior to frame processing in order to remove any streams that have exceeded their drain timeouts.
UpdateCompletedStreams(); UpdateCompletedStreams();
try try
@ -921,7 +921,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
if (_clientActiveStreamCount > _serverSettings.MaxConcurrentStreams) if (_clientActiveStreamCount > _serverSettings.MaxConcurrentStreams)
{ {
// The protocol default stream limit is infinite so the client can excede our limit at the start of the connection. // The protocol default stream limit is infinite so the client can exceed our limit at the start of the connection.
// Refused streams can be retried, by which time the client must have received our settings frame with our limit information. // Refused streams can be retried, by which time the client must have received our settings frame with our limit information.
throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.Http2ErrorMaxStreams, Http2ErrorCode.REFUSED_STREAM); throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.Http2ErrorMaxStreams, Http2ErrorCode.REFUSED_STREAM);
} }

View File

@ -124,7 +124,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.LogError(ex, "An error occured running an IConnectionCompleteFeature.OnCompleted callback."); Logger.LogError(ex, "An error occurred running an IConnectionCompleteFeature.OnCompleted callback.");
} }
} }
@ -139,7 +139,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.LogError(ex, "An error occured running an IConnectionCompleteFeature.OnCompleted callback."); Logger.LogError(ex, "An error occurred running an IConnectionCompleteFeature.OnCompleted callback.");
} }
while (onCompleted.TryPop(out var entry)) while (onCompleted.TryPop(out var entry))
@ -150,7 +150,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.LogError(ex, "An error occured running an IConnectionCompleteFeature.OnCompleted callback."); Logger.LogError(ex, "An error occurred running an IConnectionCompleteFeature.OnCompleted callback.");
} }
} }
} }

View File

@ -114,7 +114,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
Assert.Equal(stateObject, callbackState); Assert.Equal(stateObject, callbackState);
var errors = logger.Messages.Where(e => e.LogLevel >= LogLevel.Error).ToArray(); var errors = logger.Messages.Where(e => e.LogLevel >= LogLevel.Error).ToArray();
Assert.Single(errors); Assert.Single(errors);
Assert.Equal("An error occured running an IConnectionCompleteFeature.OnCompleted callback.", errors[0].Message); Assert.Equal("An error occurred running an IConnectionCompleteFeature.OnCompleted callback.", errors[0].Message);
} }
private class ThrowingListener : IConnectionListener private class ThrowingListener : IConnectionListener

View File

@ -201,7 +201,7 @@ namespace Interop.FunctionalTests
private class BulkContent : HttpContent private class BulkContent : HttpContent
{ {
private static readonly byte[] Content; private static readonly byte[] Content;
private static readonly int Repititions = 200; private static readonly int Repetitions = 200;
static BulkContent() static BulkContent()
{ {
@ -214,7 +214,7 @@ namespace Interop.FunctionalTests
protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context) protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context)
{ {
for (var i = 0; i < Repititions; i++) for (var i = 0; i < Repetitions; i++)
{ {
using (var timer = new CancellationTokenSource(TimeSpan.FromSeconds(30))) using (var timer = new CancellationTokenSource(TimeSpan.FromSeconds(30)))
{ {
@ -244,7 +244,7 @@ namespace Interop.FunctionalTests
while (read > 0) while (read > 0)
{ {
totalRead += read; totalRead += read;
Assert.True(totalRead <= Repititions * Content.Length, "Too Long"); Assert.True(totalRead <= Repetitions * Content.Length, "Too Long");
for (var offset = 0; offset < read; offset++) for (var offset = 0; offset < read; offset++)
{ {
@ -256,7 +256,7 @@ namespace Interop.FunctionalTests
read = await stream.ReadAsync(buffer, 0, buffer.Length, timer.Token).DefaultTimeout(); read = await stream.ReadAsync(buffer, 0, buffer.Length, timer.Token).DefaultTimeout();
} }
Assert.True(totalRead == Repititions * Content.Length, "Too Short"); Assert.True(totalRead == Repetitions * Content.Length, "Too Short");
} }
} }
@ -1064,7 +1064,7 @@ namespace Interop.FunctionalTests
{ {
request.Headers.Add("header" + i, oneKbString + i); request.Headers.Add("header" + i, oneKbString + i);
} }
request.Headers.Host = "localhost"; // The default Host header has a random port value wich can cause the length to vary. request.Headers.Host = "localhost"; // The default Host header has a random port value which can cause the length to vary.
var requestTask = client.SendAsync(request); var requestTask = client.SendAsync(request);
var response = await requestTask.DefaultTimeout(); var response = await requestTask.DefaultTimeout();
await serverResult.Task.DefaultTimeout(); await serverResult.Task.DefaultTimeout();
@ -1128,7 +1128,7 @@ namespace Interop.FunctionalTests
[Theory] [Theory]
// Expect this to change when the client implements dynamic request header compression. // Expect this to change when the client implements dynamic request header compression.
// Will the client send the first headers before receiving our settings frame? // Will the client send the first headers before receiving our settings frame?
// We'll probobly need to ensure the settings changes are ack'd before enforcing them. // We'll probably need to ensure the settings changes are ack'd before enforcing them.
[MemberData(nameof(SupportedSchemes))] [MemberData(nameof(SupportedSchemes))]
public async Task Settings_HeaderTableSize_CanBeReduced_Server(string scheme) public async Task Settings_HeaderTableSize_CanBeReduced_Server(string scheme)
{ {
@ -1186,7 +1186,7 @@ namespace Interop.FunctionalTests
} }
// Settings_HeaderTableSize_CanBeReduced_Client - The client uses the default 4k HPACK dynamic table size and it cannot be changed. // Settings_HeaderTableSize_CanBeReduced_Client - The client uses the default 4k HPACK dynamic table size and it cannot be changed.
// Nor does Kestrel yet support sending dynaimc table updates, so there's nothing to test here. https://github.com/dotnet/aspnetcore/issues/4715 // Nor does Kestrel yet support sending dynamic table updates, so there's nothing to test here. https://github.com/dotnet/aspnetcore/issues/4715
[Theory] [Theory]
[MemberData(nameof(SupportedSchemes))] [MemberData(nameof(SupportedSchemes))]
@ -1243,7 +1243,7 @@ namespace Interop.FunctionalTests
// SKIP: https://github.com/dotnet/aspnetcore/issues/17842 // SKIP: https://github.com/dotnet/aspnetcore/issues/17842
// The client initially issues all 10 requests before receiving the settings, has 5 refused (after receiving the settings), // The client initially issues all 10 requests before receiving the settings, has 5 refused (after receiving the settings),
// waits for the first 5 to finish, retries the refused 5, and in the end each request completes sucesfully despite the logged errors. // waits for the first 5 to finish, retries the refused 5, and in the end each request completes successfully despite the logged errors.
// Assert.Empty(TestSink.Writes.Where(context => context.Message.Contains("HTTP/2 stream error"))); // Assert.Empty(TestSink.Writes.Where(context => context.Message.Contains("HTTP/2 stream error")));
await host.StopAsync().DefaultTimeout(); await host.StopAsync().DefaultTimeout();
@ -1304,7 +1304,7 @@ namespace Interop.FunctionalTests
// SKIP: https://github.com/dotnet/aspnetcore/issues/17842 // SKIP: https://github.com/dotnet/aspnetcore/issues/17842
// The client initially issues all 10 requests before receiving the settings, has 5 refused (after receiving the settings), // The client initially issues all 10 requests before receiving the settings, has 5 refused (after receiving the settings),
// waits for the first 5 to finish, retries the refused 5, and in the end each request completes sucesfully despite the logged errors. // waits for the first 5 to finish, retries the refused 5, and in the end each request completes successfully despite the logged errors.
// Assert.Empty(TestSink.Writes.Where(context => context.Message.Contains("HTTP/2 stream error"))); // Assert.Empty(TestSink.Writes.Where(context => context.Message.Contains("HTTP/2 stream error")));
await host.StopAsync().DefaultTimeout(); await host.StopAsync().DefaultTimeout();
@ -1356,7 +1356,7 @@ namespace Interop.FunctionalTests
{ {
ConfigureKestrel(webHostBuilder, scheme); ConfigureKestrel(webHostBuilder, scheme);
webHostBuilder.ConfigureServices(AddTestLogging) webHostBuilder.ConfigureServices(AddTestLogging)
.Configure(app => app.Run(context => throw new NotImplementedException() )); .Configure(app => app.Run(context => throw new NotImplementedException()));
}); });
using var host = await hostBuilder.StartAsync().DefaultTimeout(); using var host = await hostBuilder.StartAsync().DefaultTimeout();

View File

@ -102,11 +102,11 @@ namespace Microsoft.AspNetCore.DiagnosticsViewPage.Views
private string AttributeEnding { get; set; } private string AttributeEnding { get; set; }
protected void BeginWriteAttribute(string name, string begining, int startPosition, string ending, int endPosition, int thingy) protected void BeginWriteAttribute(string name, string beginning, int startPosition, string ending, int endPosition, int thingy)
{ {
Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); Debug.Assert(string.IsNullOrEmpty(AttributeEnding));
Output.Write(begining); Output.Write(beginning);
AttributeEnding = ending; AttributeEnding = ending;
} }

View File

@ -64,7 +64,7 @@ namespace Microsoft.Extensions.RazorViews
/// <param name="stream">The stream to write to</param> /// <param name="stream">The stream to write to</param>
public async Task ExecuteAsync(Stream stream) public async Task ExecuteAsync(Stream stream)
{ {
// We technically don't need this intermediate buffer if this method accepts a memory stream. // We technically don't need this intermediate buffer if this method accepts a memory stream.
var buffer = new MemoryStream(); var buffer = new MemoryStream();
Output = new StreamWriter(buffer, UTF8NoBOM, 4096, leaveOpen: true); Output = new StreamWriter(buffer, UTF8NoBOM, 4096, leaveOpen: true);
await ExecuteAsync(); await ExecuteAsync();
@ -149,11 +149,11 @@ namespace Microsoft.Extensions.RazorViews
private string AttributeEnding { get; set; } private string AttributeEnding { get; set; }
protected void BeginWriteAttribute(string name, string begining, int startPosition, string ending, int endPosition, int thingy) protected void BeginWriteAttribute(string name, string beginning, int startPosition, string ending, int endPosition, int thingy)
{ {
Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); Debug.Assert(string.IsNullOrEmpty(AttributeEnding));
Output.Write(begining); Output.Write(beginning);
AttributeEnding = ending; AttributeEnding = ending;
} }

View File

@ -132,13 +132,13 @@ namespace Microsoft.AspNetCore.SignalR.Internal
var genericMethodInfo = adapterMethodInfo.MakeGenericMethod(streamReturnType); var genericMethodInfo = adapterMethodInfo.MakeGenericMethod(streamReturnType);
var methodParameters = genericMethodInfo.GetParameters(); var methodParameters = genericMethodInfo.GetParameters();
var methodArguements = new Expression[] var methodArguments = new Expression[]
{ {
Expression.Convert(parameters[0], methodParameters[0].ParameterType), Expression.Convert(parameters[0], methodParameters[0].ParameterType),
parameters[1], parameters[1],
}; };
var methodCall = Expression.Call(null, genericMethodInfo, methodArguements); var methodCall = Expression.Call(null, genericMethodInfo, methodArguments);
var lambda = Expression.Lambda<Func<object, CancellationToken, IAsyncEnumerable<object>>>(methodCall, parameters); var lambda = Expression.Lambda<Func<object, CancellationToken, IAsyncEnumerable<object>>>(methodCall, parameters);
return lambda.Compile(); return lambda.Compile();
} }

View File

@ -667,7 +667,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
return new AsyncEnumerableImpl<string>(CounterAsyncEnumerable(count)); return new AsyncEnumerableImpl<string>(CounterAsyncEnumerable(count));
} }
public AsyncEnumerableImplChannelThrows<string> AsyncEnumerableIsPreferedOverChannelReader(int count) public AsyncEnumerableImplChannelThrows<string> AsyncEnumerableIsPreferredOverChannelReader(int count)
{ {
return new AsyncEnumerableImplChannelThrows<string>(CounterChannel(count)); return new AsyncEnumerableImplChannelThrows<string>(CounterChannel(count));
} }

View File

@ -2136,7 +2136,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
nameof(StreamingHub.CounterAsyncEnumerable), nameof(StreamingHub.CounterAsyncEnumerable),
nameof(StreamingHub.CounterAsyncEnumerableAsync), nameof(StreamingHub.CounterAsyncEnumerableAsync),
nameof(StreamingHub.CounterAsyncEnumerableImpl), nameof(StreamingHub.CounterAsyncEnumerableImpl),
nameof(StreamingHub.AsyncEnumerableIsPreferedOverChannelReader), nameof(StreamingHub.AsyncEnumerableIsPreferredOverChannelReader),
}; };
foreach (var method in methods) foreach (var method in methods)

View File

@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.SignalR.StackExchangeRedis
internal async Task<IConnectionMultiplexer> ConnectAsync(TextWriter log) internal async Task<IConnectionMultiplexer> ConnectAsync(TextWriter log)
{ {
// Factory is publically settable. Assigning to a local variable before null check for thread safety. // Factory is publicly settable. Assigning to a local variable before null check for thread safety.
var factory = ConnectionFactory; var factory = ConnectionFactory;
if (factory == null) if (factory == null)
{ {