Skip to content

Commit

Permalink
ensure success for xsrf
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkoSekulic committed Oct 28, 2024
1 parent 383899d commit c8e7d0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
using var httpRequestMessageXsrf = new HttpRequestMessage(HttpMethod.Get, xsrfUrl);

using var xsrfResponse = await base.SendAsync(httpRequestMessageXsrf, cancellationToken);
xsrfResponse.EnsureSuccessStatusCode();

string xsrfToken = AuthenticationUtil.GetXsrfTokenFromCookie(xsrfResponse.Headers.GetValues(Microsoft.Net.Http.Headers.HeaderNames.SetCookie));
request.AddXsrfToken(xsrfToken);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Designer.Tests.Fixtures;
using Designer.Tests.Fixtures;
using Microsoft.AspNetCore.Mvc.Testing;
using Xunit;

Expand Down

0 comments on commit c8e7d0c

Please sign in to comment.