Commit ed60b6fc90ed21b7375ef9822fee61eee2fc6d0e

Authored by Dmitriy Zaporozhets
2 parents 3432c9ae dbd9d8d4

Merge pull request #3071 from dmedvinsky/fix-webhook-auth

Fix WebHook and special symbols in credentials
Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
app/models/web_hook.rb
... ... @@ -28,10 +28,14 @@ class WebHook < ActiveRecord::Base
28 28 WebHook.post(url, body: data.to_json, headers: { "Content-Type" => "application/json" })
29 29 else
30 30 post_url = url.gsub("#{parsed_url.userinfo}@", "")
  31 + auth = {
  32 + username: URI.decode(parsed_url.user),
  33 + password: URI.decode(parsed_url.password),
  34 + }
31 35 WebHook.post(post_url,
32 36 body: data.to_json,
33 37 headers: {"Content-Type" => "application/json"},
34   - basic_auth: {username: parsed_url.user, password: parsed_url.password})
  38 + basic_auth: auth)
35 39 end
36 40 end
37 41  
... ...