forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStopRoutingHandler.cs
More file actions
28 lines (26 loc) · 1.4 KB
/
StopRoutingHandler.cs
File metadata and controls
28 lines (26 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace System.Web.Http.Routing
{
/// <summary>
/// Represents a handler that specifies routing should not handle requests for a route template. When a route provides this class as a handler, requests matching against the route will be ignored.
/// </summary>
public sealed class StopRoutingHandler : HttpMessageHandler
{
/// <summary>
/// Like <see cref="T:System.Web.Routing.StopRoutingHandler"/>, the handler does nothing but throws a NotSupportedException. This method should never be called,
/// and the NotSupportedException should never be thrown directly, because this handler will be replaced by responding a message saying that no route is matched.
/// </summary>
/// <param name="request">The HTTP request message to send.</param>
/// <param name="cancellationToken">The notification that operations should be canceled.</param>
/// <returns>Throws NotSupportedException.</returns>
protected override Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request, CancellationToken cancellationToken)
{
throw new NotSupportedException();
}
}
}