<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><tt>Hi Pasan,</tt></p>
    <p><tt>Thank you for the report - I have spotted and fixed [1] a bug
        in rest_append_hf() that could definitely lead to a world of
        problems. Can you try to pull the latest version of 2.3 and try
        again? If you're running off packages, the only option is to
        wait until tomorrow and deploy the nightly built ones. </tt></p>
    <p><tt>Cheers,<br>
      </tt></p>
    <p><tt>[1]: <a class="moz-txt-link-freetext" href="https://github.com/OpenSIPS/opensips/commit/888d5e9b3f9">https://github.com/OpenSIPS/opensips/commit/888d5e9b3f9</a></tt><br>
    </p>
    <pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 15.02.2018 11:53, Pasan Meemaduma
      via Users wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:2131409490.1428017.1518688424855@mail.yahoo.com">
      <div style="color:#000; background-color:#fff; font-family:標楷體,
        dfkai-sb;font-size:16px">
        <div id="yui_3_16_0_ym19_1_1518659984271_50326">Hi List,</div>
        <div id="yui_3_16_0_ym19_1_1518659984271_50327"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1518659984271_50328">I'm
          trying to use rest_append_hf function to append an extra
          header for my rest call. But it doesn't set it unless I call
          the same function twice.</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1518659984271_50298"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1518659984271_50329">How do
          I get around this ? I tried async() statement as well as per
          docs but it didn't work either.</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1518659984271_50330"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1518659984271_50331">I'm
          using opensips 2.3.3</div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1518659984271_50332"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1518659984271_50299">route(xxxx);<br
            id="yui_3_16_0_ym19_1_1518659984271_50339">
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1518659984271_50415"><br>
        </div>
        <div dir="ltr" id="yui_3_16_0_ym19_1_1518659984271_50340">route[xxxx]
          {<br id="yui_3_16_0_ym19_1_1518659984271_50390">
              rest_append_hf("Accept: application/vnd.xxx.vapi+json;
          version=2");<br id="yui_3_16_0_ym19_1_1518659984271_50391">
              $var(rc) = rest_post(<a class="moz-txt-link-rfc2396E" href="http://{{API_USER}}:{{API_SECRET}}@{{API_HOST}}/xx/xx/xx">"http://{{ API_USER }}:{{ API_SECRET
          }}@{{ API_HOST }}/xx/xx/xx"</a>, "{ \"xx\": { \"xx\": [
          \"$var(auth_user)\" ] }}", "application/json", "$var(body)",
          "$var(ct)", "$var(rcode)");<br
            id="yui_3_16_0_ym19_1_1518659984271_50392">
              $json(res) := $var(body);<br
            id="yui_3_16_0_ym19_1_1518659984271_50394">
              if($json(res/success) != 1 ) {<br
            id="yui_3_16_0_ym19_1_1518659984271_50395">
                  xlog("L_ERR", "API: Failed to Blocked call request -
          M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br
            id="yui_3_16_0_ym19_1_1518659984271_50396">
              } else {<br id="yui_3_16_0_ym19_1_1518659984271_50397">
                  xlog("L_WARN", "API: Blocked call request - M=$rm
          RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br
            id="yui_3_16_0_ym19_1_1518659984271_50398">
              }<br id="yui_3_16_0_ym19_1_1518659984271_50399">
          }<br id="yui_3_16_0_ym19_1_1518659984271_50400">
          <br>
        </div>
        <div id="yui_3_16_0_ym19_1_1518659984271_50205">Accept header
          will only send if I call route(xxxx) twice :/.</div>
        <div id="yui_3_16_0_ym19_1_1518659984271_50494"><br>
        </div>
        <div id="yui_3_16_0_ym19_1_1518659984271_50495"><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>