Browse Source

Properly escape query to allow space

master
Kenneth Bruen 9 months ago
parent
commit
19130fe481
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 4
      src/home.zig

4
src/home.zig

@ -28,7 +28,9 @@ fn fetchThread(state: *AppState) !void {
curl.reset();
const query = try std.fmt.allocPrint(allocator, "query={s}&results=10&addresses=false&poi=false&pretty=false", .{station_name_buf.slice()});
const station_name_escaped = try std.Uri.escapeQuery(allocator, station_name_buf.slice());
defer allocator.free(station_name_escaped);
const query = try std.fmt.allocPrint(allocator, "query={s}&results=10&addresses=false&poi=false&pretty=false", .{station_name_escaped});
defer allocator.free(query);
locations_uri.query = query;
defer locations_uri.query = null;

Loading…
Cancel
Save