From 73cc3fcd12a9562c8cc700201ed3c60bad0b1d9d Mon Sep 17 00:00:00 2001
From: jpds <jpds@web>
Date: Thu, 19 Jan 2023 16:28:19 +0000
Subject: [PATCH] Added a comment

---
 ..._ae9308a3bab8904dd0f501cbe2f09de0._comment | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 doc/bugs/S3_remote_errors_with_garage_endpoint/comment_3_ae9308a3bab8904dd0f501cbe2f09de0._comment

diff --git a/doc/bugs/S3_remote_errors_with_garage_endpoint/comment_3_ae9308a3bab8904dd0f501cbe2f09de0._comment b/doc/bugs/S3_remote_errors_with_garage_endpoint/comment_3_ae9308a3bab8904dd0f501cbe2f09de0._comment
new file mode 100644
index 0000000000..c796318031
--- /dev/null
+++ b/doc/bugs/S3_remote_errors_with_garage_endpoint/comment_3_ae9308a3bab8904dd0f501cbe2f09de0._comment
@@ -0,0 +1,43 @@
+[[!comment format=mdwn
+ username="jpds"
+ avatar="http://cdn.libravatar.org/avatar/24d746ec6a7726b162c12ecceb3ee267"
+ subject="comment 3"
+ date="2023-01-19T16:28:19Z"
+ content="""
+I believe the fix for this is:
+
+```
+diff --git a/Remote/S3.hs b/Remote/S3.hs
+index f5014202e..49f2ebd58 100644
+--- a/Remote/S3.hs
++++ b/Remote/S3.hs
+@@ -948,8 +948,8 @@ s3Configuration c = cfg
+                        | otherwise -> AWS.HTTP
+        cfg = case getRemoteConfigValue signatureField c of
+                Just (SignatureVersion 4) ->
+-                       S3.s3v4 proto endpoint False S3.SignWithEffort
+-               _ -> S3.s3 proto endpoint False
++                       S3.s3v4 proto datacenter False S3.SignWithEffort
++               _ -> S3.s3 proto datacenter False
+
+ data S3Info = S3Info
+        { bucket :: S3.Bucket
+```
+
+...however I cannot test it myself right now as it's failing to compile on another bit of code:
+
+```
+[452 of 679] Compiling Remote.S3
+
+git/joeyh/git-annex.branchable.com/Remote/S3.hs:922:68: error:
+    • Couldn't match type ‘B8.ByteString’ with ‘[Char]’
+      Expected type: String
+        Actual type: B8.ByteString
+    • In the first argument of ‘T.pack’, namely ‘datacenter’
+      In the second argument of ‘($)’, namely ‘T.pack datacenter’
+      In the expression: AWS.s3HostName $ T.pack datacenter
+    |
+922 |                 | h == AWS.s3DefaultHost = AWS.s3HostName $ T.pack datacenter
+    |                                                                    ^^^^^^^^^^
+```
+"""]]