Mercurial > hg > orthanc
comparison Core/HttpServer/EmbeddedResourceHttpHandler.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 | 8d1845feb277 |
comparison
equal
deleted
inserted
replaced
900:1b92ce45cc8d | 901:7d88f3f4a3b3 |
---|---|
49 Toolbox::SplitUriComponents(baseUri_, baseUri); | 49 Toolbox::SplitUriComponents(baseUri_, baseUri); |
50 resourceId_ = resourceId; | 50 resourceId_ = resourceId; |
51 } | 51 } |
52 | 52 |
53 | 53 |
54 bool EmbeddedResourceHttpHandler::IsServedUri(const UriComponents& uri) | |
55 { | |
56 return Toolbox::IsChildUri(baseUri_, uri); | |
57 } | |
58 | |
59 | |
60 bool EmbeddedResourceHttpHandler::Handle( | 54 bool EmbeddedResourceHttpHandler::Handle( |
61 HttpOutput& output, | 55 HttpOutput& output, |
62 HttpMethod method, | 56 HttpMethod method, |
63 const UriComponents& uri, | 57 const UriComponents& uri, |
64 const Arguments& headers, | 58 const Arguments& headers, |
65 const Arguments& arguments, | 59 const Arguments& arguments, |
66 const std::string&) | 60 const std::string&) |
67 { | 61 { |
62 if (!Toolbox::IsChildUri(baseUri_, uri)) | |
63 { | |
64 // This URI is not served by this handler | |
65 return false; | |
66 } | |
67 | |
68 if (method != HttpMethod_Get) | 68 if (method != HttpMethod_Get) |
69 { | 69 { |
70 output.SendMethodNotAllowedError("GET"); | 70 output.SendMethodNotAllowedError("GET"); |
71 return true; | 71 return true; |
72 } | 72 } |