djmnz / RestFluencing

MIT License
11 stars 4 forks source link

Response now includes all headers #6

Closed adarmus closed 5 years ago

adarmus commented 5 years ago

Hi,

We are trying to use RestFluencing to check for response headers, like "ETag", but when we assert with HasHeader() it only 'sees' some headers. For example, the "ETag" header returned from GET https://api.github.com/users/defunkt is not seen, and .HasHeader("ETag") will fail.

This seems to come down to the fact that IApiClientResponse is only populated with response.Content.Headers (instead of response.Headers). HttpContentHeaders will only include a subset of all headers: https://docs.microsoft.com/en-us/dotnet/api/system.net.http.headers.httpcontentheaders?view=netframework-4.7.2

This PR will make all headers available to asserts.

Adam

djmnz commented 5 years ago

released as 0.9.2