X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fhttp%2Fserver.cpp;h=9bdfa61ac153cb188ea4688ad5a911df4114f539;hb=f839e84e68924129a9fa5941ad82e4e9cc1def4d;hp=e0b34b382e8a9d86e0a9c0a862a2a9250fa2220a;hpb=0165ed331051ae7fc64dfe85dd7ab8f5b11ba919;p=libs%2Fnet.git diff --git a/source/http/server.cpp b/source/http/server.cpp index e0b34b3..9bdfa61 100644 --- a/source/http/server.cpp +++ b/source/http/server.cpp @@ -23,6 +23,11 @@ Server::Server(unsigned port): sock.listen(*addr, 8); } +// Avoid emitting sigc::signal destructor in files including server.h +Server::~Server() +{ +} + unsigned Server::get_port() const { const Net::SockAddr &addr = sock.get_local_address(); @@ -106,6 +111,11 @@ void Server::client_data_available(Client &cl) response = new Response(NOT_IMPLEMENTED); response->add_content("Method not implemented\n"); } + else if(cl.request->get_path()[0]!='/') + { + response = new Response(BAD_REQUEST); + response->add_content("Path must be absolute\n"); + } } catch(const exception &e) {