mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 15:55:46 +00:00
Add route server
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user