<p>I just tried with master and 5.1 branches and all is ok.</p>
<pre><code>event_route[xhttp:request] {
        append_to_reply("X-Orig: $si:$sp\r\n");

        xhttp_reply("200", "OK", "", "");
}
</code></pre>
<p>Then:</p>
<pre><code># curl -v http://192.168.188.25:5060
* Rebuilt URL to: http://192.168.188.25:5060/
*   Trying 192.168.188.25...
* TCP_NODELAY set
* Connected to 192.168.188.25 (192.168.188.25) port 5060 (#0)
> GET / HTTP/1.1
> Host: 192.168.188.25:5060
> User-Agent: curl/7.60.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Sia: SIP/2.0/TCP 192.168.188.25:58888
< X-Orig: 192.168.188.25:58888
< Server: kamailio (5.1.4 (x86_64/darwin))
< Content-Length: 0
<
* Connection #0 to host 192.168.188.25 left intact
</code></pre>
<p>So either is an older kamailio version or something specific for your settings.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1548#issuecomment-399389233">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZWJfvhYF0jxeupNkwjgZpstrAqNEks5t_L6agaJpZM4UQFlv">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZRiXqV1lKGdARyF-WgCo2NzF3bGTks5t_L6agaJpZM4UQFlv.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","potentialAction":{"@type":"ViewAction","target":"https://github.com/kamailio/kamailio/issues/1548#issuecomment-399389233","url":"https://github.com/kamailio/kamailio/issues/1548#issuecomment-399389233","name":"View Issue"},"description":"View this Issue on GitHub","publisher":{"@type":"Organization","name":"GitHub","url":"https://github.com"}}</script>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1548: I just tried with master and 5.1 branches and all is ok.\r\n\r\n```\r\nevent_route[xhttp:request] {\r\n\tappend_to_reply(\"X-Orig: $si:$sp\\r\\n\");\r\n\r\n\txhttp_reply(\"200\", \"OK\", \"\", \"\");\r\n}\r\n```\r\n\r\nThen:\r\n\r\n```\r\n# curl -v http://192.168.188.25:5060\r\n* Rebuilt URL to: http://192.168.188.25:5060/\r\n*   Trying 192.168.188.25...\r\n* TCP_NODELAY set\r\n* Connected to 192.168.188.25 (192.168.188.25) port 5060 (#0)\r\n\u003e GET / HTTP/1.1\r\n\u003e Host: 192.168.188.25:5060\r\n\u003e User-Agent: curl/7.60.0\r\n\u003e Accept: */*\r\n\u003e\r\n\u003c HTTP/1.1 200 OK\r\n\u003c Sia: SIP/2.0/TCP 192.168.188.25:58888\r\n\u003c X-Orig: 192.168.188.25:58888\r\n\u003c Server: kamailio (5.1.4 (x86_64/darwin))\r\n\u003c Content-Length: 0\r\n\u003c\r\n* Connection #0 to host 192.168.188.25 left intact\r\n```\r\n\r\nSo either is an older kamailio version or something specific for your settings."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1548#issuecomment-399389233"}}}</script>
<script type="application/ld+json">{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [kamailio/kamailio] Append_to_reply does not work for XHTTP responses without body (#1548)",
"sections": [
{
"text": "",
"activityTitle": "**Daniel-Constantin Mierla**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@miconda",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1548,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1548\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1548#issuecomment-399389233"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 339761519\n}"
}
],
"themeColor": "26292E"
}</script>