comparison OrthancFramework/Sources/HttpServer/HttpToolbox.cpp @ 4326:83c5bd439fcc

fix for stone
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 24 Nov 2020 19:43:10 +0100
parents bf7b9edf6b81
children 9684a690ca63
comparison
equal deleted inserted replaced
4325:b96aedfa8cc1 4326:83c5bd439fcc
186 compiled[source[i].first] = source[i].second; 186 compiled[source[i].first] = source[i].second;
187 } 187 }
188 } 188 }
189 189
190 190
191 #if ORTHANC_SANDBOXED != 1
191 bool HttpToolbox::SimpleGet(std::string& result, 192 bool HttpToolbox::SimpleGet(std::string& result,
192 IHttpHandler& handler, 193 IHttpHandler& handler,
193 RequestOrigin origin, 194 RequestOrigin origin,
194 const std::string& uri, 195 const std::string& uri,
195 const IHttpHandler::Arguments& httpHeaders) 196 const IHttpHandler::Arguments& httpHeaders)
210 else 211 else
211 { 212 {
212 return false; 213 return false;
213 } 214 }
214 } 215 }
215 216 #endif
216 217
218
219 #if ORTHANC_SANDBOXED != 1
217 static bool SimplePostOrPut(std::string& result, 220 static bool SimplePostOrPut(std::string& result,
218 IHttpHandler& handler, 221 IHttpHandler& handler,
219 RequestOrigin origin, 222 RequestOrigin origin,
220 HttpMethod method, 223 HttpMethod method,
221 const std::string& uri, 224 const std::string& uri,
240 else 243 else
241 { 244 {
242 return false; 245 return false;
243 } 246 }
244 } 247 }
245 248 #endif
246 249
250
251 #if ORTHANC_SANDBOXED != 1
247 bool HttpToolbox::SimplePost(std::string& result, 252 bool HttpToolbox::SimplePost(std::string& result,
248 IHttpHandler& handler, 253 IHttpHandler& handler,
249 RequestOrigin origin, 254 RequestOrigin origin,
250 const std::string& uri, 255 const std::string& uri,
251 const void* bodyData, 256 const void* bodyData,
252 size_t bodySize, 257 size_t bodySize,
253 const IHttpHandler::Arguments& httpHeaders) 258 const IHttpHandler::Arguments& httpHeaders)
254 { 259 {
255 return SimplePostOrPut(result, handler, origin, HttpMethod_Post, uri, bodyData, bodySize, httpHeaders); 260 return SimplePostOrPut(result, handler, origin, HttpMethod_Post, uri, bodyData, bodySize, httpHeaders);
256 } 261 }
257 262 #endif
258 263
264
265 #if ORTHANC_SANDBOXED != 1
259 bool HttpToolbox::SimplePut(std::string& result, 266 bool HttpToolbox::SimplePut(std::string& result,
260 IHttpHandler& handler, 267 IHttpHandler& handler,
261 RequestOrigin origin, 268 RequestOrigin origin,
262 const std::string& uri, 269 const std::string& uri,
263 const void* bodyData, 270 const void* bodyData,
264 size_t bodySize, 271 size_t bodySize,
265 const IHttpHandler::Arguments& httpHeaders) 272 const IHttpHandler::Arguments& httpHeaders)
266 { 273 {
267 return SimplePostOrPut(result, handler, origin, HttpMethod_Put, uri, bodyData, bodySize, httpHeaders); 274 return SimplePostOrPut(result, handler, origin, HttpMethod_Put, uri, bodyData, bodySize, httpHeaders);
268 } 275 }
269 276 #endif
270 277
278
279 #if ORTHANC_SANDBOXED != 1
271 bool HttpToolbox::SimpleDelete(IHttpHandler& handler, 280 bool HttpToolbox::SimpleDelete(IHttpHandler& handler,
272 RequestOrigin origin, 281 RequestOrigin origin,
273 const std::string& uri, 282 const std::string& uri,
274 const IHttpHandler::Arguments& httpHeaders) 283 const IHttpHandler::Arguments& httpHeaders)
275 { 284 {
282 HttpOutput http(stream, false /* no keep alive */); 291 HttpOutput http(stream, false /* no keep alive */);
283 292
284 return handler.Handle(http, origin, LOCALHOST, "", HttpMethod_Delete, curi, 293 return handler.Handle(http, origin, LOCALHOST, "", HttpMethod_Delete, curi,
285 httpHeaders, getArguments, NULL /* no body for DELETE */, 0); 294 httpHeaders, getArguments, NULL /* no body for DELETE */, 0);
286 } 295 }
296 #endif
287 } 297 }