version 5.1.0

PIHTTPServer now can handle path with partially *, ** and {} path arguments
PIHTTP::MessageConst add queryArguments() and pathArguments(). arguments() now union of these args
This commit is contained in:
2025-08-28 19:48:19 +03:00
parent 27f37c9cc1
commit ef8b785ac6
8 changed files with 327 additions and 120 deletions

View File

@@ -93,8 +93,8 @@ bool MicrohttpdServerConnection::ready() {
req.setMethod(method);
req.setPath(path);
req.setBody(body);
req.headers() = headers;
req.arguments() = args;
req.headers() = headers;
req.queryArguments() = args;
rep.setCode(Code::BadRequest);
if (server->callback) rep = server->callback(req);
MicrohttpdServer::addFixedHeaders(rep);
@@ -150,14 +150,14 @@ void log_callback(void * cls, const char * fmt, va_list ap) {
int iterate_post(void * conn_cls,
MHD_ValueKind kind,
const char * key,
const char * filename,
const char * content_type,
const char * transfer_encoding,
const char * data,
uint64_t off,
size_t size) {
MHD_ValueKind kind,
const char * key,
const char * filename,
const char * content_type,
const char * transfer_encoding,
const char * data,
uint64_t off,
size_t size) {
MicrohttpdServerConnection * conn = (MicrohttpdServerConnection *)conn_cls;
if (!conn) return MHD_NO;
conn->post[PIString::fromUTF8(key)] = PIString::fromUTF8(data);
@@ -195,13 +195,13 @@ int args_iterate(void * cls, MHD_ValueKind kind, const char * key, const char *
int answer_callback(void * cls,
MHD_Connection * connection,
const char * url,
const char * method,
const char * version,
const char * upload_data,
size_t * upload_data_size,
void ** con_cls) {
MHD_Connection * connection,
const char * url,
const char * method,
const char * version,
const char * upload_data,
size_t * upload_data_size,
void ** con_cls) {
MicrohttpdServer * server = (MicrohttpdServer *)cls;
Method m = Method::Unknown;