Frontend: Don't allow viewing private channel logs without access
This commit is contained in:
14
frontend.pm
14
frontend.pm
@@ -297,6 +297,18 @@ sub sendBadRequest {
|
||||
$aClient->send($response);
|
||||
}
|
||||
|
||||
sub sendUnauthorized {
|
||||
my $aClient = $_[0];
|
||||
my $aMessage = $_[1];
|
||||
|
||||
my $content = "<h1>401 Unauthorized</h1><h6>irclogger_web</h6>Error: $aMessage";
|
||||
my $response = getBaseResponse(401, "Unauthorized");
|
||||
$response.="Content-Type: text/html, charset=utf-8\r\n";
|
||||
$response.="Content-Length: ".length($content)."\r\n\r\n";
|
||||
$response.=$content;
|
||||
$aClient->send($response);
|
||||
}
|
||||
|
||||
sub sendForbidden {
|
||||
my $aClient = $_[0];
|
||||
my $aMessage = $_[1];
|
||||
@@ -429,7 +441,7 @@ sub sendResponse {
|
||||
my $aRequest = $_[1];
|
||||
my $aConnection = $_[2];
|
||||
|
||||
if($aRequest->{"version"} ne "HTTP/1.1") {
|
||||
if($aRequest->{"version"} ne "HTTP/1.0" && $aRequest->{"version"} ne "HTTP/1.1") {
|
||||
sendNotImplemented($aClient);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user