Properly escape query to allow space
This commit is contained in:
parent
5d74b3a896
commit
19130fe481
1 changed files with 3 additions and 1 deletions
|
@ -28,7 +28,9 @@ fn fetchThread(state: *AppState) !void {
|
||||||
|
|
||||||
curl.reset();
|
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);
|
defer allocator.free(query);
|
||||||
locations_uri.query = query;
|
locations_uri.query = query;
|
||||||
defer locations_uri.query = null;
|
defer locations_uri.query = null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue