mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 13:51:47 +00:00
* Move uWebSockets and uSockets forks into Bun's repository * Update Makefile * Update settings.json * Update libuwsockets.cpp * Remove backends we won't be using * Update bindings.cpp --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
22 lines
665 B
C++
22 lines
665 B
C++
extern "C" {
|
|
#include "quic.h"
|
|
}
|
|
|
|
namespace uWS {
|
|
|
|
struct Http3Request {
|
|
|
|
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 == (int) key.length() && !memcmp(name, key.data(), key.length())) {
|
|
return {value, (size_t) value_length};
|
|
}
|
|
}
|
|
}
|
|
return {nullptr, 0};
|
|
}
|
|
};
|
|
} |