Everywhere: Use session->path()
This commit is contained in:
parent
ff5a07dc04
commit
66074a5472
31 changed files with 48 additions and 48 deletions
|
@ -1,4 +1,4 @@
|
|||
if (String.BeginsWith("/api/v1/accounts", @slon_http_request_path(session))) {
|
||||
if (String.BeginsWith("/api/v1/accounts", session->path())) {
|
||||
@slon_api_v1_accounts_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (String.BeginsWith("/users/", @slon_http_request_path(session)) && String.EndsWith("json", session->header("accept"))) {
|
||||
if (String.BeginsWith("/users/", session->path()) && String.EndsWith("json", session->header("accept"))) {
|
||||
@slon_activitypub_users_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (!StrICmp("/api/v1/blocks", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v1/blocks", session->path())) {
|
||||
@slon_api_v1_blocks_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (!StrICmp("/api/v1/bookmarks", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v1/bookmarks", session->path())) {
|
||||
@slon_api_v1_bookmarks_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (!StrICmp("/api/v1/conversations", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v1/conversations", session->path())) {
|
||||
@slon_api_v1_conversations_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (!StrICmp("/api/v1/custom_emojis", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v1/custom_emojis", session->path())) {
|
||||
@slon_api_v1_custom_emojis_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (!StrICmp("/api/v1/favourites", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v1/favourites", session->path())) {
|
||||
@slon_api_v1_favourites_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
if (!StrICmp("/api/v1/filters", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v1/filters", session->path())) {
|
||||
@slon_api_v1_filters_get(session);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!StrICmp("/api/v2/filters", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v2/filters", session->path())) {
|
||||
@slon_api_v2_filters_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (!StrICmp("/api/v1/follow_requests", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v1/follow_requests", session->path())) {
|
||||
@slon_api_v1_follow_requests_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (!StrICmp("/api/v1/followed_tags", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v1/followed_tags", session->path())) {
|
||||
@slon_api_v1_followed_tags_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
if (!StrICmp("/api/v1/instance", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v1/instance", session->path())) {
|
||||
session->send(db->o("instance"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!StrICmp("/api/v2/instance", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v2/instance", session->path())) {
|
||||
@slon_api_v2_instance_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (!StrICmp("/nodeinfo/2.0", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/nodeinfo/2.0", session->path())) {
|
||||
@slon_nodeinfo_20(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (String.BeginsWith("/api/v1/notifications", @slon_http_request_path(session))) {
|
||||
if (String.BeginsWith("/api/v1/notifications", session->path())) {
|
||||
@slon_api_v1_notifications_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
if (!StrICmp("/oauth/authorize", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/oauth/authorize", session->path())) {
|
||||
@slon_http_send_html_file(session, "M:/Slon/Static/oauth/authorize.html");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!StrICmp("/oauth/verify_access", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/oauth/verify_access", session->path())) {
|
||||
@slon_oauth_verify_access_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (!StrICmp("/api/v2/search", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v2/search", session->path())) {
|
||||
@slon_api_v2_search_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (!StrICmp("/api/v2/suggestions", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/api/v2/suggestions", session->path())) {
|
||||
@slon_api_v2_suggestions_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (String.BeginsWith("/api/v1/timelines", @slon_http_request_path(session))) {
|
||||
if (String.BeginsWith("/api/v1/timelines", session->path())) {
|
||||
@slon_api_v1_timelines_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
if (String.EndsWith(".css", @slon_http_request_path(session))) {
|
||||
if (String.EndsWith(".css", session->path())) {
|
||||
session->content_type("text/css");
|
||||
@slon_http_send_file(session, "M:/Slon/Static/css/main.css");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!StrICmp("/js/header.js", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/js/header.js", session->path())) {
|
||||
session->content_type("text/javascript");
|
||||
@slon_http_send_file(session, "M:/Slon/Static/js/header.js");
|
||||
return;
|
||||
}
|
||||
|
||||
if (String.EndsWith(".js", @slon_http_request_path(session))) {
|
||||
if (String.EndsWith(".js", session->path())) {
|
||||
session->content_type("text/javascript");
|
||||
@slon_http_send_file(session, "M:/Slon/Static/js/statuses.js");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!StrICmp("/alec.png", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/alec.png", session->path())) {
|
||||
session->content_type("image/png");
|
||||
@slon_http_send_file(session, "A:/avatar-circle-4bpp.png");
|
||||
return;
|
||||
}
|
||||
|
||||
if (String.BeginsWith("/@", @slon_http_request_path(session))) {
|
||||
if (String.BeginsWith("/@", session->path())) {
|
||||
@slon_web_user_get(session);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
if (!StrICmp("/.well-known/host-meta", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/.well-known/host-meta", session->path())) {
|
||||
@slon_host_meta(session);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!StrICmp("/.well-known/nodeinfo", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/.well-known/nodeinfo", session->path())) {
|
||||
@slon_nodeinfo(session);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!StrICmp("/.well-known/oauth-authorization-server", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/.well-known/oauth-authorization-server", session->path())) {
|
||||
@slon_oauth_well_known(session);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!StrICmp("/.well-known/webfinger", @slon_http_request_path(session))) {
|
||||
if (!StrICmp("/.well-known/webfinger", session->path())) {
|
||||
@slon_webfinger(session);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue