Hotfix for HttpEndpointMiddleware
Fixes that subpath no longer matched any workflows
This commit is contained in:
parent
3a6a4b5264
commit
e3c3a32853
|
|
@ -11,7 +11,7 @@ environment:
|
|||
sonarcloud_api_key:
|
||||
secure: qaE9kOVkGGFM7ZMf3YeliZxDU9udTCy6W5xXHJ9T+tXv5qXPMYlIdR7hyNgxW04A
|
||||
|
||||
version: 2.2.0-preview.{build}
|
||||
version: 2.1.1.{build}
|
||||
|
||||
init:
|
||||
- cmd: git config --global core.autocrlf true
|
||||
|
|
|
|||
|
|
@ -40,19 +40,26 @@ namespace Elsa.Activities.Http.Middleware
|
|||
var basePath = options.Value.BasePath;
|
||||
var request = httpContext.Request;
|
||||
|
||||
string path;
|
||||
|
||||
// If a base path was configured, try to match against that first.
|
||||
if (basePath != null)
|
||||
{
|
||||
// If no match, continue with the next middleware in the pipeline.
|
||||
if (!request.Path.StartsWithSegments(basePath.Value))
|
||||
if (!request.Path.StartsWithSegments(basePath.Value, out _, out var remainingPath))
|
||||
{
|
||||
await _next(httpContext);
|
||||
return;
|
||||
}
|
||||
|
||||
path = remainingPath.Value.ToLowerInvariant();
|
||||
}
|
||||
else
|
||||
{
|
||||
path = httpContext.Request.Path.Value.ToLowerInvariant();
|
||||
}
|
||||
|
||||
var cancellationToken = CancellationToken.None; // Prevent half-way request abortion (which also happens when WriteHttpResponse writes to the response).
|
||||
var path = httpContext.Request.Path.Value.ToLowerInvariant();
|
||||
var method = httpContext.Request.Method!.ToLowerInvariant();
|
||||
|
||||
request.TryGetCorrelationId(out var correlationId);
|
||||
|
|
|
|||
Loading…
Reference in a new issue