Merge pull request #3071 from dmedvinsky/fix-webhook-auth
Fix WebHook and special symbols in credentials
This commit is contained in:
commit
ed60b6fc90
1 changed files with 5 additions and 1 deletions
|
@ -28,10 +28,14 @@ class WebHook < ActiveRecord::Base
|
|||
WebHook.post(url, body: data.to_json, headers: { "Content-Type" => "application/json" })
|
||||
else
|
||||
post_url = url.gsub("#{parsed_url.userinfo}@", "")
|
||||
auth = {
|
||||
username: URI.decode(parsed_url.user),
|
||||
password: URI.decode(parsed_url.password),
|
||||
}
|
||||
WebHook.post(post_url,
|
||||
body: data.to_json,
|
||||
headers: {"Content-Type" => "application/json"},
|
||||
basic_auth: {username: parsed_url.user, password: parsed_url.password})
|
||||
basic_auth: auth)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue