From 6755099c36e46699b78b570caf02fdd8b3b443b9 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Wed, 30 Aug 2023 13:49:56 -0700 Subject: [PATCH] apparently we do need that check? --- src/aws_signing.zig | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/aws_signing.zig b/src/aws_signing.zig index bc02a4c..4454a41 100644 --- a/src/aws_signing.zig +++ b/src/aws_signing.zig @@ -409,11 +409,7 @@ fn canonicalUri(allocator: std.mem.Allocator, path: []const u8, double_encode: b log.debug("encoding path: {s}", .{path}); var encoded_once = try encodeUri(allocator, path); log.debug("encoded path (1): {s}", .{encoded_once}); - // The line below had this condition, with the additional comment - // "Is the indexOf condition universally true?" - // Right now I'm not sure why this was added, but it seems to be a mistake - // or std.mem.indexOf(u8, path, "%") != null) { // Is the indexOf condition universally true? - if (!double_encode) { + if (!double_encode or std.mem.indexOf(u8, path, "%") != null) { // TODO: Is the indexOf condition universally true? if (std.mem.lastIndexOf(u8, encoded_once, "?")) |i| { _ = allocator.resize(encoded_once, i); return encoded_once[0..i];