comparison hg-web/main.c @ 190:a2725419f988 hg-web

Updated so that bun builds will with already existing js files.
author MrJuneJune <me@mrjunejune.com>
date Sat, 24 Jan 2026 21:06:42 -0800
parents 32ce881452fa
children 9f4429c49733
comparison
equal deleted inserted replaced
188:32ce881452fa 190:a2725419f988
152 Seobeo_Client_Response *hg_response = hg_proxy_request("GET", hg_path, NULL, NULL); 152 Seobeo_Client_Response *hg_response = hg_proxy_request("GET", hg_path, NULL, NULL);
153 153
154 Seobeo_Log(SEOBEO_DEBUG, "ApiGetFile: status=%i body_len=%zu\n", hg_response->status_code, hg_response->body_length); 154 Seobeo_Log(SEOBEO_DEBUG, "ApiGetFile: status=%i body_len=%zu\n", hg_response->status_code, hg_response->body_length);
155 155
156 char status[4]; 156 char status[4];
157 snprintf(status, 3, "%i", hg_response->status_code); 157 snprintf(status, 4, "%i", hg_response->status_code);
158 158
159 if (!hg_response->body) 159 if (!hg_response->body)
160 { 160 {
161 Dowa_HashMap_Push_Arena(resp, "status", "502", arena); 161 Dowa_HashMap_Push_Arena(resp, "status", "502", arena);
162 Dowa_HashMap_Push_Arena(resp, "content-type", "text/plain", arena); 162 Dowa_HashMap_Push_Arena(resp, "content-type", "text/plain", arena);
176 176
177 char *temp1 = Dowa_Arena_Copy(arena, hg_response->body, hg_response->body_length); 177 char *temp1 = Dowa_Arena_Copy(arena, hg_response->body, hg_response->body_length);
178 char *temp2 = Dowa_Arena_Allocate(arena, 256); 178 char *temp2 = Dowa_Arena_Allocate(arena, 256);
179 snprintf(temp2, 256, "%zu", hg_response->body_length); 179 snprintf(temp2, 256, "%zu", hg_response->body_length);
180 180
181 Dowa_HashMap_Push_Arena(resp, "status", status, arena); 181 Dowa_HashMap_Push_Arena(resp, "status", "200", arena);
182 Dowa_HashMap_Push_Arena(resp, "content-type", "text/plain", arena); 182 Dowa_HashMap_Push_Arena(resp, "content-type", "text/plain", arena);
183 Dowa_HashMap_Push_Arena(resp, "body", temp1, arena); 183 Dowa_HashMap_Push_Arena(resp, "body", temp1, arena);
184 Dowa_HashMap_Push_Arena(resp, "content-length", temp2, arena); 184 Dowa_HashMap_Push_Arena(resp, "content-length", temp2, arena);
185 185
186 return resp; 186 return resp;