Add route server

This commit is contained in:
2026-01-12 14:05:38 -06:00
parent 848fca7f36
commit e96b359bb8
2 changed files with 2 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ namespace Tesses::Framework::Http
auto path = Tesses::Framework::Filesystem::VFSPath::ParseUriPath(ctx.path); auto path = Tesses::Framework::Filesystem::VFSPath::ParseUriPath(ctx.path);
for(auto& svr : this->routes) for(auto& svr : this->routes)
{ {
if(svr.method != ctx.method) continue; if(svr.method != ctx.method && !((svr.method == "GET" && ctx.method == "HEAD") || (svr.method == "HEAD" && ctx.method == "GET"))) continue;
ctx.pathArguments = pathArgs; ctx.pathArguments = pathArgs;
if(svr.Equals(path, ctx.pathArguments) && svr.handler && svr.handler(ctx)) if(svr.Equals(path, ctx.pathArguments) && svr.handler && svr.handler(ctx))
return true; return true;

View File

@@ -47,7 +47,7 @@ extern "C" {
#if defined(AF_UNIX) && !defined(GEKKO) && !defined(__SWITCH__) && !defined(__PS2__) #if defined(AF_UNIX) && !defined(GEKKO) && !defined(__SWITCH__) && !defined(__PS2__)
#include <sys/un.h> #include <sys/un.h>
#endif #endif
#include <sys/poll.h> #include <poll.h>
} }
#endif #endif
#if defined(GEKKO) #if defined(GEKKO)