diff --git a/Slon/Api/V2/Instance.HC b/Slon/Api/V2/Instance.HC index 6d5f118..6a1b119 100644 --- a/Slon/Api/V2/Instance.HC +++ b/Slon/Api/V2/Instance.HC @@ -4,6 +4,6 @@ U0 @slon_api_v2_instance_get(SlonHttpSession* session) no_warn request_json; StrPrint(scratch_buffer, "{\"domain\":\"%s\"}", db->o("instance")->@("uri")); - @slon_http_set_content_type(session, "application/json; charset=utf-8"); + session->content_type("application/json; charset=utf-8"); session->send(scratch_buffer); } diff --git a/Slon/Endpoints/Get/Web.HC b/Slon/Endpoints/Get/Web.HC index d2231a4..3231a0e 100644 --- a/Slon/Endpoints/Get/Web.HC +++ b/Slon/Endpoints/Get/Web.HC @@ -1,23 +1,23 @@ if (String.EndsWith(".css", @slon_http_request_path(session))) { - @slon_http_set_content_type(session, "text/css"); + 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))) { - @slon_http_set_content_type(session, "text/javascript"); + 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))) { - @slon_http_set_content_type(session, "text/javascript"); + 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))) { - @slon_http_set_content_type(session, "image/png"); + session->content_type("image/png"); @slon_http_send_file(session, "A:/avatar-circle-4bpp.png"); return; } diff --git a/Slon/Http/AdminServer.HC b/Slon/Http/AdminServer.HC index 94a5552..1c1ab94 100644 --- a/Slon/Http/AdminServer.HC +++ b/Slon/Http/AdminServer.HC @@ -254,7 +254,7 @@ U0 @slon_admin_new_account(SlonHttpSession* session) if (db->o("actors")->@(request_json->@("username"))) { StrPrint(scratch_buffer, "{\"error\":\"account already exists\"}"); - @slon_http_set_content_type(session, "application/json"); + session->content_type("application/json"); session->send(scratch_buffer, StrLen(scratch_buffer)); } else { @slon_admin_create_account(session); @@ -276,7 +276,7 @@ U0 @slon_admin_info_stats(SlonHttpSession* session) String.Append(scratch_buffer, "\"uptime\":\"%d\"", cnts.jiffies); String.Append(scratch_buffer, "}"); - @slon_http_set_content_type(session, "application/json"); + session->content_type("application/json"); session->send(scratch_buffer, StrLen(scratch_buffer)); } diff --git a/Slon/Http/LocalServer.HC b/Slon/Http/LocalServer.HC index e8c94d1..e0527bf 100644 --- a/Slon/Http/LocalServer.HC +++ b/Slon/Http/LocalServer.HC @@ -2,38 +2,38 @@ U0 @slon_local_server_set_mime_type(SlonHttpSession* session, U8* filepath) { // FIXME: Do this programmatically like the Jakt version, this is awful if (String.EndsWith(".html", filepath)) { - @slon_http_set_content_type(session, "text/html"); + session->content_type("text/html"); return; } if (String.EndsWith(".txt", filepath)) { - @slon_http_set_content_type(session, "text/plain"); + session->content_type("text/plain"); return; } if (String.EndsWith(".css", filepath)) { - @slon_http_set_content_type(session, "text/css"); + session->content_type("text/css"); return; } if (String.EndsWith(".js", filepath)) { - @slon_http_set_content_type(session, "text/javascript"); + session->content_type("text/javascript"); return; } if (String.EndsWith(".json", filepath)) { - @slon_http_set_content_type(session, "application/json"); + session->content_type("application/json"); return; } if (String.EndsWith(".gif", filepath)) { - @slon_http_set_content_type(session, "image/gif"); + session->content_type("image/gif"); return; } if (String.EndsWith(".png", filepath)) { - @slon_http_set_content_type(session, "image/png"); + session->content_type("image/png"); return; } if (String.EndsWith(".jpeg", filepath) || String.EndsWith(".jpg", filepath)) { - @slon_http_set_content_type(session, "image/jpeg"); + session->content_type("image/jpeg"); return; } - @slon_http_set_content_type(session, "application/octet-stream"); + session->content_type("application/octet-stream"); } U0 @slon_local_server_send_file(SlonHttpSession* session, U8* filepath) @@ -106,7 +106,7 @@ U0 @slon_local_server_directory_listing(SlonHttpSession* session, U8* path) String.Append(html, "
Slon static file webserver for (TempleOS) Server"); String.Append(html, "