Permalink
Browse files

bugfix: strip leading / in pathname when no path is present

using a hostname of http://www.redmine.org will result in the pathname being /, and since we append slashes already it would be //endpoint.
  • Loading branch information...
1 parent 8247ba2 commit d3a66205dd12e173144b2ab95b8b8febd8aa4645 @robhurring committed Jan 28, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/scripts/redmine.coffee
@@ -282,10 +282,11 @@ class Redmine
"X-Redmine-API-Key": @token
endpoint = URL.parse(@url)
+ pathname = endpoint.pathname.replace /^\/$/, ''
options =
"host" : endpoint.hostname
- "path" : "#{endpoint.pathname}#{path}"
+ "path" : "#{pathname}#{path}"
"method" : method
"headers": headers

0 comments on commit d3a6620

Please sign in to comment.