Adding UrlEncoder to the ServiceCollection
This commit is contained in:
parent
ef0ea537e2
commit
37c167aa74
|
|
@ -108,8 +108,8 @@ namespace Microsoft.AspNet.Builder
|
||||||
}
|
}
|
||||||
|
|
||||||
var inlineConstraintResolver = routeBuilder
|
var inlineConstraintResolver = routeBuilder
|
||||||
.ServiceProvider
|
.ServiceProvider
|
||||||
.GetRequiredService<IInlineConstraintResolver>();
|
.GetRequiredService<IInlineConstraintResolver>();
|
||||||
|
|
||||||
routeBuilder.Routes.Add(new Route(
|
routeBuilder.Routes.Add(new Route(
|
||||||
routeBuilder.DefaultHandler,
|
routeBuilder.DefaultHandler,
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Text.Encodings.Web;
|
||||||
using Microsoft.AspNet.Routing;
|
using Microsoft.AspNet.Routing;
|
||||||
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
|
|
||||||
namespace Microsoft.Extensions.DependencyInjection
|
namespace Microsoft.Extensions.DependencyInjection
|
||||||
{
|
{
|
||||||
|
|
@ -25,6 +27,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
throw new ArgumentNullException(nameof(setupAction));
|
throw new ArgumentNullException(nameof(setupAction));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
services.TryAddSingleton(UrlEncoder.Default);
|
||||||
services.Configure(setupAction);
|
services.Configure(setupAction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue