mirror of
https://github.com/Seldaek/monolog.git
synced 2025-02-23 22:42:38 +01:00
Use custom host in header as well
This commit is contained in:
parent
1fbe8c2641
commit
46825bdb95
@ -62,6 +62,11 @@ class HipChatHandler extends SocketHandler
|
||||
*/
|
||||
private $format;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $host;
|
||||
|
||||
/**
|
||||
* @param string $token HipChat API Token
|
||||
* @param string $room The room that should be alerted of the message (Id or Name)
|
||||
@ -87,6 +92,7 @@ class HipChatHandler extends SocketHandler
|
||||
$this->notify = $notify;
|
||||
$this->room = $room;
|
||||
$this->format = $format;
|
||||
$this->host = $host;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -131,7 +137,7 @@ class HipChatHandler extends SocketHandler
|
||||
private function buildHeader($content)
|
||||
{
|
||||
$header = "POST /v1/rooms/message?format=json&auth_token=".$this->token." HTTP/1.1\r\n";
|
||||
$header .= "Host: api.hipchat.com\r\n";
|
||||
$header .= "Host: {$this->host}\r\n";
|
||||
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
|
||||
$header .= "Content-Length: " . strlen($content) . "\r\n";
|
||||
$header .= "\r\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user