Last active
May 19, 2017 01:51
-
-
Save yoshimov/f653dd8a262840a6b832b752c53b91af to your computer and use it in GitHub Desktop.
mastodon v1.3.3 patch for http server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /mastodon/app/lib/tag_manager.rb.org | |
+++ /mastodon/app/lib/tag_manager.rb | |
@@ -69,7 +69,7 @@ | |
uri = Addressable::URI.new | |
uri.host = domain.gsub(/[\/]/, '') | |
- uri.normalize.host | |
+ uri.normalize.authority | |
end | |
def same_acct?(canonical, needle) | |
--- /mastodon/vendor/bundle/ruby/2.4.0/gems/goldfinger-1.2.0/lib/goldfinger/client.rb.org | |
+++ /mastodon/vendor/bundle/ruby/2.4.0/gems/goldfinger-1.2.0/lib/goldfinger/client.rb | |
@@ -19,10 +19,13 @@ | |
Goldfinger::Result.new(response) | |
rescue HTTP::Error | |
- raise Goldfinger::NotFoundError unless ssl | |
- | |
+ raise Goldfinger::NotFoundError unless ssl and ENV['LOCAL_HTTPS'] == 'false' | |
ssl = false | |
retry | |
+ rescue OpenSSL::SSL::SSLError | |
+ raise Goldfinger::SSLError unless ssl and ENV['LOCAL_HTTPS'] == 'false' | |
+ ssl = false | |
+ retry | |
end | |
rescue HTTP::Error | |
raise Goldfinger::NotFoundError | |
@@ -40,8 +43,11 @@ | |
begin | |
template = perform_get(url(ssl)) | |
rescue HTTP::Error | |
- raise Goldfinger::NotFoundError unless ssl | |
- | |
+ raise Goldfinger::NotFoundError unless ssl and ENV['LOCAL_HTTPS'] == 'false' | |
+ ssl = false | |
+ retry | |
+ rescue OpenSSL::SSL::SSLError | |
+ raise Goldfinger::SSLError unless ssl and ENV['LOCAL_HTTPS'] == 'false' | |
ssl = false | |
retry | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment