Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ internal static partial class EndpointRouteBuilderExtensions
public static void UseSignalRHubSpecification(this IEndpointRouteBuilder endpointRouteBuilder)
{
// Actually, it does not use middleware.
endpointRouteBuilder.MapGet(""/signalr-dev/spec.json"", (HttpContext context) =>
endpointRouteBuilder.MapGet(""/signalr-dev/spec.json"", async (HttpContext context) =>
{
context.Response.StatusCode = StatusCodes.Status200OK;
context.Response.ContentType = ""application/json"";

context.Response.BodyWriter.Write(GetSpecJsonBytes());
context.Response.BodyWriter.Complete();
var jsonBytes = GetSpecJsonBytes();
await context.Response.Body.WriteAsync(jsonBytes);
});
}

private static partial ReadOnlySpan<byte> GetSpecJsonBytes();
private static partial ReadOnlyMemory<byte> GetSpecJsonBytes();
}
";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace TypedSignalR.Client.DevTools;

internal static partial class EndpointRouteBuilderExtensions
{{
private static partial ReadOnlySpan<byte> GetSpecJsonBytes() => new byte[] {{ {str} }};
private static partial ReadOnlyMemory<byte> GetSpecJsonBytes() => new byte[] {{ {str} }};
}}";
}
}