# HG changeset patch # User Sebastien Jodogne # Date 1531403677 -7200 # Node ID c8d369400ae144a992e7266a79b934f118b2fb1e # Parent c1e351b6abec1a426bc8ced4a8c06e71accf97e2 fix issue #77 diff -r c1e351b6abec -r c8d369400ae1 Core/Lua/LuaContext.cpp --- a/Core/Lua/LuaContext.cpp Thu Jul 12 15:11:42 2018 +0200 +++ b/Core/Lua/LuaContext.cpp Thu Jul 12 15:54:37 2018 +0200 @@ -287,7 +287,17 @@ if (nArgs >= 2 && !lua_isnil(state, 2)) { - that.httpClient_.SetBody(lua_tostring(state, 2)); + size_t bodySize = 0; + const char* bodyData = lua_tolstring(state, 2, &bodySize); + + if (bodySize == 0) + { + that.httpClient_.GetBody().clear(); + } + else + { + that.httpClient_.GetBody().assign(bodyData, bodySize); + } } else { diff -r c1e351b6abec -r c8d369400ae1 NEWS --- a/NEWS Thu Jul 12 15:11:42 2018 +0200 +++ b/NEWS Thu Jul 12 15:54:37 2018 +0200 @@ -45,11 +45,12 @@ Maintenance ----------- +* Configuration option "LogExportedResources" is now "false" by default +* Header "OrthancCppDatabasePlugin.h" is now part of the "orthanc-databases" project * Fix generation of DICOMDIR if PatientID is empty * Fix issue 25 (Deadlock with Lua scripts): The event queue is now implemented for Lua * Fix issue 94 (Instance modification should not modify FrameOfReferenceUID) -* Configuration option "LogExportedResources" is now "false" by default -* Header "OrthancCppDatabasePlugin.h" is now part of the "orthanc-databases" project +* Fix issue 77 (Lua access to REST-API is null terminated) * Upgraded dependencies for static and Windows builds: - boost 1.67.0 - openssl 1.0.2o