Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/bitcoin/node/protocols/protocol_html.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BCN_API protocol_html

/// Message handlers by http method.
void handle_receive_get(const code& ec,
const network::http::method::get& request) NOEXCEPT override;
const network::http::method::get::cptr& get) NOEXCEPT override;

/// Dispatch.
virtual bool try_dispatch_object(
Expand Down
22 changes: 11 additions & 11 deletions src/protocols/protocol_html.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,54 +34,54 @@ BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
// ----------------------------------------------------------------------------

void protocol_html::handle_receive_get(const code& ec,
const method::get& request) NOEXCEPT
const method::get::cptr& get) NOEXCEPT
{
BC_ASSERT(stranded());

if (stopped(ec))
return;

// Enforce http origin form for get.
if (!is_origin_form(request->target()))
if (!is_origin_form(get->target()))
{
send_bad_target(*request);
send_bad_target(*get);
return;
}

// Enforce http origin policy (if any origins are configured).
if (!is_allowed_origin(*request, request->version()))
if (!is_allowed_origin(*get, get->version()))
{
send_forbidden(*request);
send_forbidden(*get);
return;
}

// Enforce http host header (if any hosts are configured).
if (!is_allowed_host(*request, request->version()))
if (!is_allowed_host(*get, get->version()))
{
send_bad_host(*request);
send_bad_host(*get);
return;
}

// Always try API dispatch, false if unhandled.
if (try_dispatch_object(*request))
if (try_dispatch_object(*get))
return;

// Require file system dispatch if path is configured (always handles).
if (!options_.path.empty())
{
dispatch_file(*request);
dispatch_file(*get);
return;
}

// Require embedded dispatch if site is configured (always handles).
if (options_.pages.enabled())
{
dispatch_embedded(*request);
dispatch_embedded(*get);
return;
}

// Neither site is enabled and object dispatch doesn't support.
send_not_implemented(*request);
send_not_implemented(*get);
}

// Dispatch.
Expand Down
Loading