mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
Reject invalid requests on peer port sooner.
This commit is contained in:
committed by
Tom Ritchford
parent
33175187b7
commit
982dc6aa8c
@@ -191,6 +191,15 @@ void runCoroutine (RPC::Coroutine coroutine, JobQueue& jobQueue)
|
||||
void
|
||||
ServerHandlerImp::onRequest (HTTP::Session& session)
|
||||
{
|
||||
// Make sure RPC is enabled on the port
|
||||
if (session.port().protocol.count("http") == 0 &&
|
||||
session.port().protocol.count("https") == 0)
|
||||
{
|
||||
HTTPReply (403, "Forbidden", makeOutput (session));
|
||||
session.close (true);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check user/password authorization
|
||||
if (! authorized (session.port(),
|
||||
build_map(session.request().headers)))
|
||||
|
||||
Reference in New Issue
Block a user