@@ -144,7 +144,8 @@ struct curlFileTransfer : public FileTransfer
144
144
// Handle S3 URLs with curl-based AWS SigV4 authentication
145
145
if (hasPrefix (request.uri , " s3://" )) {
146
146
try {
147
- auto [httpsUrl, parsed] = fileTransfer.convertS3ToHttpsUri (request.uri );
147
+ auto parsed = ParsedS3URL::parse (request.uri );
148
+ auto httpsUrl = fileTransfer.s3ToHttpsUrl (parsed);
148
149
149
150
// Update the request URI to use HTTPS
150
151
const_cast <FileTransferRequest &>(request).uri = httpsUrl.to_string ();
@@ -872,12 +873,10 @@ struct curlFileTransfer : public FileTransfer
872
873
873
874
#if NIX_WITH_S3_SUPPORT
874
875
/* *
875
- * Convert S3 URI to HTTPS URI for use with curl's AWS SigV4 authentication
876
+ * Convert ParsedS3URL to HTTPS ParsedURL for use with curl's AWS SigV4 authentication
876
877
*/
877
- std::pair< ParsedURL, ParsedS3URL> convertS3ToHttpsUri (const std::string & s3Uri )
878
+ ParsedURL s3ToHttpsUrl (const ParsedS3URL & parsed )
878
879
{
879
- auto parsed = ParsedS3URL::parse (s3Uri);
880
-
881
880
std::string region = parsed.region .value_or (" us-east-1" );
882
881
std::string scheme = parsed.scheme .value_or (" https" );
883
882
@@ -904,7 +903,7 @@ struct curlFileTransfer : public FileTransfer
904
903
httpsUrl.authority = ParsedURL::Authority{.host = " s3." + region + " .amazonaws.com" };
905
904
}
906
905
907
- return { httpsUrl, parsed} ;
906
+ return httpsUrl;
908
907
}
909
908
#endif
910
909
void enqueueFileTransfer (const FileTransferRequest & request, Callback<FileTransferResult> callback) override
0 commit comments