use explicit splitScalar
This commit is contained in:
parent
e665b94683
commit
f558b058e1
|
@ -392,7 +392,7 @@ fn verifyParsedAuthorization(
|
||||||
// Credential=ACCESS/20230908/us-west-2/s3/aws4_request
|
// Credential=ACCESS/20230908/us-west-2/s3/aws4_request
|
||||||
// SignedHeaders=accept;content-length;content-type;host;x-amz-content-sha256;x-amz-date;x-amz-storage-class
|
// SignedHeaders=accept;content-length;content-type;host;x-amz-content-sha256;x-amz-date;x-amz-storage-class
|
||||||
// Signature=fcc43ce73a34c9bd1ddf17e8a435f46a859812822f944f9eeb2aabcd64b03523
|
// Signature=fcc43ce73a34c9bd1ddf17e8a435f46a859812822f944f9eeb2aabcd64b03523
|
||||||
var credential_iterator = std.mem.split(u8, credential, "/");
|
var credential_iterator = std.mem.splitScalar(u8, credential, '/');
|
||||||
const access_key = credential_iterator.next().?;
|
const access_key = credential_iterator.next().?;
|
||||||
const credentials = credentials_fn(access_key) orelse return error.CredentialsNotFound;
|
const credentials = credentials_fn(access_key) orelse return error.CredentialsNotFound;
|
||||||
// TODO: https://stackoverflow.com/questions/29276609/aws-authentication-requires-a-valid-date-or-x-amz-date-header-curl
|
// TODO: https://stackoverflow.com/questions/29276609/aws-authentication-requires-a-valid-date-or-x-amz-date-header-curl
|
||||||
|
@ -750,7 +750,7 @@ fn canonicalQueryString(allocator: std.mem.Allocator, path: []const u8) ![]const
|
||||||
const query = path[first_question.? + 1 ..];
|
const query = path[first_question.? + 1 ..];
|
||||||
|
|
||||||
// Split this by component
|
// Split this by component
|
||||||
var portions = std.mem.split(u8, query, "&");
|
var portions = std.mem.splitScalar(u8, query, '&');
|
||||||
var sort_me = std.ArrayList([]const u8).init(allocator);
|
var sort_me = std.ArrayList([]const u8).init(allocator);
|
||||||
defer sort_me.deinit();
|
defer sort_me.deinit();
|
||||||
while (portions.next()) |item|
|
while (portions.next()) |item|
|
||||||
|
|
|
@ -371,7 +371,7 @@ fn proxyFromString(string: []const u8) !std.http.Client.Proxy {
|
||||||
rc.port = 443;
|
rc.port = 443;
|
||||||
rc.protocol = .tls;
|
rc.protocol = .tls;
|
||||||
} else return error.InvalidScheme;
|
} else return error.InvalidScheme;
|
||||||
var split_iterator = std.mem.split(u8, remaining, ":");
|
var split_iterator = std.mem.splitScalar(u8, remaining, ':');
|
||||||
rc.host = std.mem.trimRight(u8, split_iterator.first(), "/");
|
rc.host = std.mem.trimRight(u8, split_iterator.first(), "/");
|
||||||
if (split_iterator.next()) |port|
|
if (split_iterator.next()) |port|
|
||||||
rc.port = try std.fmt.parseInt(u16, port, 10);
|
rc.port = try std.fmt.parseInt(u16, port, 10);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user