VirtualBox

Ignore:
Timestamp:
Jun 29, 2019 12:06:56 AM (5 years ago)
Author:
vboxsync
Message:

IPRT/rest: Fix inverted logic to specify kDoCall_RequireBody flag. We
need it precisely when the body parameter is *not* required at the
REST level - we need to sign the body even if it's empty.

Regen the C++ API sources, where InstanceAction is now the only
operation affected by the (cumulative) mustache changes.

bugref:9436 bugref:9167

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/rest/RTCRestClientApiBaseOci.cpp

    r79411 r79427  
    144144    if (RT_SUCCESS(rc))
    145145    {
    146         if (   a_rStrXmitBody.isNotEmpty()
    147             || (a_fFlags & kDoCall_RequireBody)
     146        bool fHasBody = a_rStrXmitBody.isNotEmpty() || (a_fFlags & kDoCall_RequireBody);
     147
     148        if (   fHasBody
    148149            || a_enmHttpMethod == RTHTTPMETHOD_POST
    149150            || a_enmHttpMethod == RTHTTPMETHOD_PUT)
    150151            rc = ociSignRequestEnsureContentLength(a_hHttp, a_rStrXmitBody.length());
    151152        if (   RT_SUCCESS(rc)
    152             && a_rStrXmitBody.isNotEmpty())
     153            && fHasBody)
    153154            rc = ociSignRequestEnsureXContentSha256(a_hHttp, a_rStrXmitBody.c_str(), a_rStrXmitBody.length());
    154155        if (RT_SUCCESS(rc))
     
    162163        }
    163164    }
    164     RT_NOREF_PV(a_fFlags); /* We don't need to use the kDoCall_OciReqSignExcludeBody flag it turns out. */
    165165    return rc;
    166166}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette