More h3 wrap up
This commit is contained in:
+17
-1
@@ -1,6 +1,22 @@
|
||||
extern "C" {
|
||||
#include "quic.h"
|
||||
}
|
||||
|
||||
namespace uWS {
|
||||
|
||||
struct Http3Request {
|
||||
// really the same thing as HttpRequest with same rules
|
||||
|
||||
std::string_view getHeader(std::string_view key) {
|
||||
for (int i = 0, more = 1; more; i++) {
|
||||
char *name, *value;
|
||||
int name_length, value_length;
|
||||
if (more = us_quic_socket_context_get_header(nullptr, i, &name, &name_length, &value, &value_length)) {
|
||||
if (name_length == key.length() && !memcmp(name, key.data(), key.length())) {
|
||||
return {value, value_length};
|
||||
}
|
||||
}
|
||||
return {nullptr, 0};
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user