diff options
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 |