I would like to determine if there is an X_FORWARDED_FOR value in a request made to my NancyFX handler. In MVC, this is stored in the ServerVariables collection named HttpRequest.
Where should I look for the same value in NancyFX?
All HTTP request headers are available in your module through the Request property on the NancyModule . For instance:.
Request
NancyModule
public class MyModule : NancyModule { public MyModule() { Get["/"] =_ => Request.Headers["X-Forwarded-For"].Any() ? HttpStatusCode.OK : HttpStatusCode.BadRequest; } }
Source: https://habr.com/ru/post/1489078/More articles:How to convert std :: chrono :: system_clock :: duration to struct timeval - chronoHow to show print dialog in Crystal Report? - c #Unexpected behavior when adding '\ 0' to std :: string - c ++how to switch database in codeigniter - databaseAndroid JsonArray and JsonObject deserialisation - jsonLaravel 4: default error messages - laravelIE permission rejected - javascriptScala: An idiomatic way to generate a fixed-length sequence (folding an infinite stream?) - scalaHandling query strings? - symfonylibwebsockets: how to close a connection - cAll Articles