diff options
author | Leon Breedt <bitserf@gmail.com> | 2005-04-28 01:19:52 +0000 |
---|---|---|
committer | Leon Breedt <bitserf@gmail.com> | 2005-04-28 01:19:52 +0000 |
commit | 896fea505b67f6dd842a58c72bcd919c593d925a (patch) | |
tree | 35c03f53bc2f890e7720608a27fabc0e6162eb72 /actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb | |
parent | 74c9fd2ba50964cd44b9ff34a63bdecdfbd1ab62 (diff) | |
download | rails-896fea505b67f6dd842a58c72bcd919c593d925a.tar.gz rails-896fea505b67f6dd842a58c72bcd919c593d925a.tar.bz2 rails-896fea505b67f6dd842a58c72bcd919c593d925a.zip |
add charset=utf-8 to SOAP response content type, and make base_uri
respect relative_url_root for the endpoint of SOAP messages (Shugo
Maeda). if WSDL was retrieved over HTTPS, use HTTPS in the endpoint
URLs as well.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1244 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb')
-rw-r--r-- | actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb index 38fc7e4410..bce3f4e944 100644 --- a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb +++ b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb @@ -167,8 +167,16 @@ module ActionWebService # :nodoc: private def base_uri - host = @request ? (@request.env['HTTP_HOST'] || @request.env['SERVER_NAME']) : 'localhost' - 'http://%s/%s/' % [host, controller_name] + if @request + host = @request.env['HTTP_HOST'] || @request.env['SERVER_NAME'] + relative_url_root = @request.relative_url_root + scheme = @request.ssl? ? 'https' : 'http' + else + host = 'localhost' + relative_url_root = "" + scheme = 'http' + end + '%s://%s%s/%s/' % [scheme, host, relative_url_root, controller_name] end def to_wsdl |