Skip to content

Commit d9a1e1a

Browse files
committed
Fixes from production deployment
* Remove unnecessary files * Fix typo * Force HTTP 1.1 for "old-style" signed requests
1 parent 266be63 commit d9a1e1a

File tree

4 files changed

+4
-19
lines changed

4 files changed

+4
-19
lines changed

fasp_base/app/mailers/fasp_base/application_mailer.rb

Lines changed: 0 additions & 6 deletions
This file was deleted.

fasp_base/lib/fasp_base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Error < ::StandardError ; end
1515
mattr_accessor :fediverse_account
1616

1717
def self.base_url
18-
protocol = Rails.env.production? ? "https:" : "http"
18+
protocol = Rails.env.production? ? "https" : "http"
1919
"#{protocol}://#{domain}/fasp"
2020
end
2121
end

fasp_data_sharing/app/mailers/fasp_data_sharing/application_mailer.rb

Lines changed: 0 additions & 6 deletions
This file was deleted.

fasp_data_sharing/app/models/fasp_data_sharing/activity_pub_object.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@ def fetch
1717
private
1818

1919
def message_signature_request
20-
request_with_headers(message_signature_headers)
20+
HTTPX.with(headers: message_signature_headers).get(uri)
2121
end
2222

23+
# Forces HTTP 1.1 because http/2 does not allow the `Host` header we sign
2324
def signature_request
24-
request_with_headers(signature_headers)
25-
end
26-
27-
def request_with_headers(headers)
28-
HTTPX.with(headers:).get(uri)
25+
HTTPX.with(ssl: { alpn_protocols: %w[http/1.1] }, headers: signature_headers).get(uri)
2926
end
3027

3128
def message_signature_headers

0 commit comments

Comments
 (0)