#### [Abblix\.Utils](https://www.abblix.com/en/docs/api/abblix-utils 'index')
### [Abblix\.Utils](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils 'Abblix\.Utils')

## AddressValidatingHttpMessageHandler Class

The message\-handler half of protecting a server\-initiated request whose address came from outside: it refuses
redirects and re\-checks the address immediately before every send, leaving only the policy \- which addresses
are refused \- to the derived handler\.

```csharp
public abstract class AddressValidatingHttpMessageHandler : System.Net.Http.DelegatingHandler
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → [System\.Net\.Http\.HttpMessageHandler](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpmessagehandler 'System\.Net\.Http\.HttpMessageHandler') → [System\.Net\.Http\.DelegatingHandler](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.delegatinghandler 'System\.Net\.Http\.DelegatingHandler') → AddressValidatingHttpMessageHandler

### Remarks
Two properties make this the right place for the check rather than a pre\-flight in front of the client\.

Redirects are not followed. A receiver that answers a delivery with a 3xx to an internal address would
otherwise have the request re-sent there, past any address the caller vetted, so this is the difference
between a check and a bypass. With the follow disabled the 3xx comes back as an ordinary non-success response
and the caller decides what to do with it.

The address is judged here, one call before the connection, rather than only when the request was scheduled.
A name that resolved to a public address a moment ago can resolve to an internal one now, so the resolution a
derived handler performs in [Abblix\.Utils\.AddressValidatingHttpMessageHandler\.GuardAsync\(System\.Uri,System\.Threading\.CancellationToken\)](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.addressvalidatinghttpmessagehandler.guardasync#abblix-utils-addressvalidatinghttpmessagehandler-guardasync(system-uri-system-threading-cancellationtoken) 'Abblix\.Utils\.AddressValidatingHttpMessageHandler\.GuardAsync\(System\.Uri,System\.Threading\.CancellationToken\)') is the one whose answer the socket actually uses.
