From 1fd42fbe845d3e7f81499facf0c51fa56ada0649 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Wed, 19 Jan 2022 21:40:38 -0800 Subject: [PATCH] fixed signature issue with rest_json_1_work_with_lambda There remains another issue with this same test, dealing with query string --- src/aws_signing.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aws_signing.zig b/src/aws_signing.zig index f597dc8..f43a21a 100644 --- a/src/aws_signing.zig +++ b/src/aws_signing.zig @@ -386,7 +386,7 @@ fn canonicalUri(allocator: std.mem.Allocator, path: []const u8, double_encode: b log.debug("encoding path: {s}", .{path}); const encoded_once = try encodeUri(allocator, path); log.debug("encoded path (1): {s}", .{encoded_once}); - if (!double_encode) + if (!double_encode or std.mem.indexOf(u8, path, "%") != null) // TODO: Is the indexOf condition universally true? return encoded_once[0 .. std.mem.lastIndexOf(u8, encoded_once, "?") orelse encoded_once.len]; defer allocator.free(encoded_once); const encoded_twice = try encodeUri(allocator, encoded_once);