|
@@ -33,8 +33,8 @@ namespace Astralis {
|
|
|
|
|
|
|
|
// On the second call we populate the `HttpRequest` object and begin the handler
|
|
// On the second call we populate the `HttpRequest` object and begin the handler
|
|
|
if (context.handler_context == null) {
|
|
if (context.handler_context == null) {
|
|
|
- // Extract all headers from the connection
|
|
|
|
|
- var headers = new Catalogue<string, string>();
|
|
|
|
|
|
|
+ // Extract all headers from the connection (case-insensitive keys)
|
|
|
|
|
+ var headers = new Catalogue<string, string>(case_insensitive_hash, case_insensitive_equal);
|
|
|
var headers_collector = new KeyValueCollector(headers);
|
|
var headers_collector = new KeyValueCollector(headers);
|
|
|
MHD.get_connection_values(connection, MHD.ValueKind.HEADER_KIND, KeyValueCollector.key_value_iterator, (void*)headers_collector);
|
|
MHD.get_connection_values(connection, MHD.ValueKind.HEADER_KIND, KeyValueCollector.key_value_iterator, (void*)headers_collector);
|
|
|
|
|
|
|
@@ -248,5 +248,15 @@ namespace Astralis {
|
|
|
// Get the InetAddress and convert to string
|
|
// Get the InetAddress and convert to string
|
|
|
return inet_addr.address.to_string();
|
|
return inet_addr.address.to_string();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // Case-insensitive hash function for strings (for HTTP header lookups)
|
|
|
|
|
+ private static uint case_insensitive_hash(string key) {
|
|
|
|
|
+ return key.down().hash();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Case-insensitive equality function for strings (for HTTP header lookups)
|
|
|
|
|
+ private static bool case_insensitive_equal(string a, string b) {
|
|
|
|
|
+ return a.down() == b.down();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|