Refactored the mess known as Hook default_url_options in favor of the simpler
:only_path as suggested by splatteal on GitHub. #2542 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2491 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
00b568c194
commit
9a986ac0a5
2 files changed
+4
-43
No files matched your search
+1
-10
@@ -60,16 +60,7 @@ module Redmine
|
||||
returning [] do |response|
|
||||
hls = hook_listeners(hook)
|
||||
if hls.any?
|
||||
request = context[:request]
|
||||
if request
|
||||
default_url_options[:host] ||= request.env["SERVER_NAME"]
|
||||
# Only set port if it's requested and isn't port 80. Otherwise a url
|
||||
# like: +http://example.com:/url+ may be generated
|
||||
if request.env["SERVER_PORT"] && request.env["SERVER_PORT"] != 80
|
||||
default_url_options[:port] ||= request.env["SERVER_PORT"]
|
||||
end
|
||||
default_url_options[:protocol] ||= request.protocol
|
||||
end
|
||||
default_url_options[:only_path] ||= true
|
||||
hls.each {|listener| response << listener.send(hook, context)}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user