diff options
author | mr <mr@mrautenberg.de> | 2011-02-08 12:58:30 +0100 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2011-02-08 12:58:30 +0100 |
commit | e4a32e37ab8708aa8ae4dbfc6069e5ea75928f3f (patch) | |
tree | 1393e22245bb56cc49bdee8bc31fd6ae4276b700 /lib/helper.rb | |
parent | 26c0b93a02fddb60175747f7733d13e973257cd8 (diff) |
manually insert code from mguetlein repository | restclientwrapper.post event with changed method call
Diffstat (limited to 'lib/helper.rb')
-rw-r--r-- | lib/helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/helper.rb b/lib/helper.rb index 0bb489c..6ca3901 100644 --- a/lib/helper.rb +++ b/lib/helper.rb @@ -28,8 +28,9 @@ helpers do #cleans URI from querystring and file-extension. Sets port 80 to emptystring # @param [String] uri def clean_uri(uri) + uri = uri.sub(" ", "%20") out = URI.parse(uri) - out.path = out.path[0, out.path.rindex(/[0-9]/) + 1] if out.path.rindex(/[0-9]/) #cuts after id for a&a + out.path = out.path[0, out.path.index(/[0-9]/)] if out.path.index(/[0-9]/) #cuts after id for a&a "#{out.scheme}:" + (out.port != 80 ? out.port : "") + "//#{out.host}#{out.path.chomp('/')}" end @@ -51,7 +52,7 @@ before do subjectid = CGI.unescape(subjectid) if subjectid.include?("%23") @subjectid = subjectid rescue - LOGGER.debug "OpenTox ruby api wrapper: helper before filter: NO subjectid for URI: #{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}#{request.env['REQUEST_URI']}" + #LOGGER.debug "OpenTox ruby api wrapper: helper before filter: NO subjectid for URI: #{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}#{request.env['REQUEST_URI']}" subjectid = "" end @subjectid = subjectid |