Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Janky] Replace all spaces in user's name when requesting a new build.

Janky is returning a 400 (Bad Request) error at times when a request for a new
build is made. Those errors are due to whitespaces that are being used in user's
names for campfire and possibly another chat engines.
Replacement of all spaces for plus signs "+" in user's names makes the URL that
is being posted to from hubot's janky script compliant to the specification [1]
and solves the issue.

[1] http://www.w3.org/Addressing/URL/url-spec.txt
  • Loading branch information...
commit bde74dbc1c94d9fae0ce8597985eeec5acd68aca 1 parent 51cb173
@rafacv rafacv authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/scripts/janky.coffee
View
2  src/scripts/janky.coffee
@@ -77,7 +77,7 @@ module.exports = (robot) ->
app = msg.match[1]
branch = msg.match[3] || "master"
room_id = msg.message.user.room
- user = msg.message.user.name
+ user = msg.message.user.name.replace(/\ /g, "+")
post "#{app}/#{branch}?room_id=#{room_id}&user=#{user}", {}, (err, statusCode, body) ->
if statusCode == 201 or statusCode == 404
Please sign in to comment.
Something went wrong with that request. Please try again.