comparison Core/HttpServer/FilesystemHttpHandler.cpp @ 901:7d88f3f4a3b3 plugins

refactoring IsServedUri, answer PNG images, regular expression groups
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Jun 2014 15:22:13 +0200
parents 7e8cde5905fd
children e078ea944089
comparison
equal deleted inserted replaced
900:1b92ce45cc8d 901:7d88f3f4a3b3
118 throw OrthancException("The path does not point to a directory"); 118 throw OrthancException("The path does not point to a directory");
119 } 119 }
120 } 120 }
121 121
122 122
123 bool FilesystemHttpHandler::IsServedUri(const UriComponents& uri)
124 {
125 return Toolbox::IsChildUri(pimpl_->baseUri_, uri);
126 }
127
128
129 bool FilesystemHttpHandler::Handle( 123 bool FilesystemHttpHandler::Handle(
130 HttpOutput& output, 124 HttpOutput& output,
131 HttpMethod method, 125 HttpMethod method,
132 const UriComponents& uri, 126 const UriComponents& uri,
133 const Arguments& headers, 127 const Arguments& headers,
134 const Arguments& arguments, 128 const Arguments& arguments,
135 const std::string&) 129 const std::string&)
136 { 130 {
131 if (!Toolbox::IsChildUri(pimpl_->baseUri_, uri))
132 {
133 // This URI is not served by this handler
134 return false;
135 }
136
137 if (method != HttpMethod_Get) 137 if (method != HttpMethod_Get)
138 { 138 {
139 output.SendMethodNotAllowedError("GET"); 139 output.SendMethodNotAllowedError("GET");
140 return true; 140 return true;
141 } 141 }