diff --git a/src/http/handler.zig b/src/http/handler.zig index 507d997..84ee063 100644 --- a/src/http/handler.zig +++ b/src/http/handler.zig @@ -169,9 +169,13 @@ fn handleWeatherInternal( } } else try ansi.render(req_alloc, weather, .{ .use_imperial = use_imperial }); - if (res.content_type != .JSON) { + // Add coordinates header using response allocator + const coords_header = try std.fmt.allocPrint(res.arena, "{d:.4},{d:.4}", .{ location.coords.latitude, location.coords.longitude }); + res.headers.add("X-Location-Coordinates", coords_header); + + if (res.content_type != .JSON) res.content_type = .TEXT; - } + res.body = output; }