PeanutButter
Loading...
Searching...
No Matches
PeanutButter.TestUtils.AspNetCore.HttpResponseExtensions Class Reference

Provides extensions for asp.net HttpResponse objects. More...

Static Public Member Functions

static IEnumerable< Cookie > ParseCookies (this HttpResponse res)
 ASP.NET core HttpResponse objects don't provide easy read mechanisms for cookies, so this extension method produces a lazily-loaded collection of System.Net.Cookie instances from Set-Cookie headers.
static SameSiteMode ReadSameSiteForCookie (this HttpResponse res, string cookieName)
 Reads the SameSite attribute for a cookie from the response headers, since System.Net.Cookie doesn't expose this.

Detailed Description

Provides extensions for asp.net HttpResponse objects.

Member Function Documentation

◆ ParseCookies()

IEnumerable< Cookie > PeanutButter.TestUtils.AspNetCore.HttpResponseExtensions.ParseCookies ( this HttpResponse res)
static

ASP.NET core HttpResponse objects don't provide easy read mechanisms for cookies, so this extension method produces a lazily-loaded collection of System.Net.Cookie instances from Set-Cookie headers.

Parameters
res
Returns

◆ ReadSameSiteForCookie()

SameSiteMode PeanutButter.TestUtils.AspNetCore.HttpResponseExtensions.ReadSameSiteForCookie ( this HttpResponse res,
string cookieName )
static

Reads the SameSite attribute for a cookie from the response headers, since System.Net.Cookie doesn't expose this.

Parameters
res
cookieName
Returns
Exceptions
CookieNotFoundException
InvalidSameSiteValueException

The documentation for this class was generated from the following file:
  • source/TestUtils/PeanutButter.TestUtils.AspNetCore/HttpResponseExtensions.cs