Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
[Janky] Replace all spaces in user's name when requesting a new build.
Browse files Browse the repository at this point in the history
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
rafacv committed Aug 1, 2012
1 parent 51cb173 commit bde74db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scripts/janky.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bde74db

Please sign in to comment.