Mercurial > hg > orthanc
comparison OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp @ 4657:e8967149d87a
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 07 May 2021 06:35:13 +0200 |
parents | 66109d24d26e |
children | b1d87d41874e |
comparison
equal
deleted
inserted
replaced
4656:82a314325351 | 4657:e8967149d87a |
---|---|
1448 | 1448 |
1449 call.GetOutput().AnswerJson(result); | 1449 call.GetOutput().AnswerJson(result); |
1450 } | 1450 } |
1451 | 1451 |
1452 | 1452 |
1453 static void SetStringContentETag(RestApiOutput& output, | 1453 static void SetStringContentETag(const RestApiOutput& output, |
1454 int64_t revision, | 1454 int64_t revision, |
1455 const std::string& value) | 1455 const std::string& value) |
1456 { | 1456 { |
1457 std::string md5; | 1457 std::string md5; |
1458 Toolbox::ComputeMD5(md5, value); | 1458 Toolbox::ComputeMD5(md5, value); |
1459 const std::string etag = "\"" + boost::lexical_cast<std::string>(revision) + "-" + md5 + "\""; | 1459 const std::string etag = "\"" + boost::lexical_cast<std::string>(revision) + "-" + md5 + "\""; |
1460 output.GetLowLevelOutput().AddHeader("ETag", etag); | 1460 output.GetLowLevelOutput().AddHeader("ETag", etag); |
1461 } | 1461 } |
1462 | 1462 |
1463 | 1463 |
1464 static void SetBufferContentETag(RestApiOutput& output, | 1464 static void SetBufferContentETag(const RestApiOutput& output, |
1465 int64_t revision, | 1465 int64_t revision, |
1466 const void* data, | 1466 const void* data, |
1467 size_t size) | 1467 size_t size) |
1468 { | 1468 { |
1469 std::string md5; | 1469 std::string md5; |
1471 const std::string etag = "\"" + boost::lexical_cast<std::string>(revision) + "-" + md5 + "\""; | 1471 const std::string etag = "\"" + boost::lexical_cast<std::string>(revision) + "-" + md5 + "\""; |
1472 output.GetLowLevelOutput().AddHeader("ETag", etag); | 1472 output.GetLowLevelOutput().AddHeader("ETag", etag); |
1473 } | 1473 } |
1474 | 1474 |
1475 | 1475 |
1476 static void SetAttachmentETag(RestApiOutput& output, | 1476 static void SetAttachmentETag(const RestApiOutput& output, |
1477 int64_t revision, | 1477 int64_t revision, |
1478 const FileInfo& info) | 1478 const FileInfo& info) |
1479 { | 1479 { |
1480 const std::string etag = ("\"" + boost::lexical_cast<std::string>(revision) + "-" + | 1480 const std::string etag = ("\"" + boost::lexical_cast<std::string>(revision) + "-" + |
1481 info.GetUncompressedMD5() + "\""); | 1481 info.GetUncompressedMD5() + "\""); |