<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sat Jan 11 08:22:32 UTC 2025

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Mojang Studios Jira</title>
    <link>https://bugs.mojang.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en</language>    <build-info>
        <version>9.12.2</version>
        <build-number>9120002</build-number>
        <build-date>10-01-2024</build-date>
    </build-info>


<item>
            <title>[BDS-18627] [Script API] Headers/Body not set on BDS GET HttpRequest calls on Linux, but is on Windows</title>
                <link>https://bugs.mojang.com/browse/BDS-18627</link>
                <project id="11700" key="BDS">Bedrock Dedicated Server</project>
                    <description>&lt;p&gt;&lt;b&gt;See comment: this is only a difference between how Windows and Linux handle GET requests.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Running a BDS server on Linux Ubuntu 20.04.6 LTS, utilizing the gametest @minecraft/server-net.HttpRequest method, and noticing that headers and request payloads are not sent from BDS on Linux while they are sent from BDS on Windows. Both client and server code is the same, and I can confirm that requests are reaching the server from the BDS client on both platforms.&lt;/p&gt;

&lt;p&gt;Running netcat on Linux shows the following:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;GET /write_state HTTP/1.1
Host: 127.0.0.1:8888
Accept: */*
User-Agent: libhttpclient/1.0.0.0&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;While running ncat on Windows shows the following:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;GET /update HTTP/1.1
Connection: Keep-Alive
User-Agent: libhttpclient/1.0.0.0
Content-Length: 53
Host: 127.0.0.1:8888

{&quot;time&quot;:5000,&quot;weather&quot;:0,&quot;entities&quot;:{},&quot;messages&quot;:[]}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Note the content length header and the payload (both requests should have a payload).&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Code sample:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&#160; &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; req = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; mcnet.HttpRequest(HOST + endpoint);
&#160; req.setTimeout(0.5);
&#160; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (body !== undefined) req.setBody(body);
&#160; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (headers !== undefined) {
&#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; headerObjs: mcnet.HttpHeader[] = [];
&#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; [k, v] of &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;.entries(headers)) {
&#160; &#160; &#160; headerObjs.push(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; mcnet.HttpHeader(k, v));
&#160; &#160; }
&#160; &#160; req.setHeaders(headerObjs);
&#160; }
&#160; let res;
&#160; &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
&#160; &#160; res = await mcnet.http.request(req);
&#160; } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;(e) {
&#160; &#160; console.error(&lt;span class=&quot;code-quote&quot;&gt;&apos;Invalid request: &apos;&lt;/span&gt;, e);
&#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;;
&#160; }&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Let me know if there is anything that would help narrow this down. Thanks!&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="540593">BDS-18627</key>
            <summary>[Script API] Headers/Body not set on BDS GET HttpRequest calls on Linux, but is on Windows</summary>
                <type id="1" iconUrl="https://bugs.mojang.com/secure/viewavatar?size=xsmall&amp;avatarId=18903&amp;avatarType=issuetype">Bug</type>
                                    <status id="5" iconUrl="https://bugs.mojang.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="4">Incomplete</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="stevarino39">stevarino</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Aug 2023 21:11:35 +0200</created>
                <updated>Tue, 14 May 2024 18:14:11 +0200</updated>
                            <resolved>Tue, 14 May 2024 18:14:11 +0200</resolved>
                                    <version>1.20.12 Hotfix</version>
                                                            <votes>1</votes>
                                    <watches>0</watches>
                                                                            <comments>
                            <comment id="1322834" author="JIRAUSER484247" created="Tue, 14 May 2024 18:14:11 +0200"  >&lt;p&gt;Cleaning up old tickets: This ticket had been set to &apos;Awaiting Response&apos;, but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.&lt;/p&gt;

&lt;p&gt;Quick Links:&lt;br/&gt;
&#128211; Issue Guidelines &#8211; &#128172; Mojang Support &#8211; &#128231; Suggestions &#8211; &#128214; Minecraft Wiki&lt;/p&gt;
</comment>
                            <comment id="1279896" author="JIRAUSER648376" created="Fri, 15 Sep 2023 12:07:08 +0200"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;Does this issue still occur after updating to 1.20.15? &lt;/p&gt;

&lt;p&gt;This ticket will automatically reopen when you reply. &lt;/p&gt;</comment>
                            <comment id="1273716" author="JIRAUSER550892" created="Mon, 7 Aug 2023 23:53:37 +0200"  >&lt;p&gt;Updated title to reflect the more accurate case: this is only a difference on GET requests on Linux vs Windows.&#160;&lt;/p&gt;

&lt;p&gt;Test Code used:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-javascript&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; * as mc from &lt;span class=&quot;code-quote&quot;&gt;&quot;@minecraft/server&quot;&lt;/span&gt;;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; * as mcnet from &lt;span class=&quot;code-quote&quot;&gt;&quot;@minecraft/server-net&quot;&lt;/span&gt;;

async &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; timeout(ticks: number) {
  &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; await &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Promise&amp;lt;&lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt;&amp;gt;(res =&amp;gt; {
    mc.system.runTimeout(res, ticks);
  });
}

async &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; testMsg() {
  async &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; sendReq(method: mcnet.HttpRequestMethod) {
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; req = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; mcnet.HttpRequest(&lt;span class=&quot;code-quote&quot;&gt;&apos;http:&lt;span class=&quot;code-comment&quot;&gt;//httpbin.org/anything&apos;&lt;/span&gt;);
&lt;/span&gt;    req.setHeaders([&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; mcnet.HttpHeader(&lt;span class=&quot;code-quote&quot;&gt;&apos;X-Custom&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;foo&apos;&lt;/span&gt;)]);
    req.setBody(&lt;span class=&quot;code-quote&quot;&gt;&apos;Test test test.&apos;&lt;/span&gt;)
    req.setMethod(method)
    &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; res = await mcnet.http.request(req);
    console.log(&lt;span class=&quot;code-quote&quot;&gt;&apos;Status:&apos;&lt;/span&gt;, res.status)
    console.log(&lt;span class=&quot;code-quote&quot;&gt;&apos;Headers:&apos;&lt;/span&gt;, JSON.stringify(res.headers.map(h =&amp;gt; [h.key, h.value])));
    console.log(&lt;span class=&quot;code-quote&quot;&gt;&apos;Body:&apos;&lt;/span&gt;, res.body);
    console.log(&lt;span class=&quot;code-quote&quot;&gt;&apos;.&apos;&lt;/span&gt;);
    console.log(&lt;span class=&quot;code-quote&quot;&gt;&apos;.&apos;&lt;/span&gt;);
    console.log(&lt;span class=&quot;code-quote&quot;&gt;&apos;.&apos;&lt;/span&gt;);
  }
  await sendReq(mcnet.HttpRequestMethod.Get);
  await timeout(60);
  await sendReq(mcnet.HttpRequestMethod.Post);
  await timeout(60);
  await sendReq(mcnet.HttpRequestMethod.Put);
  await timeout(60);
  await sendReq(mcnet.HttpRequestMethod.Delete);
}

testMsg();
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Post, Delete, and Put all behaved identically.&lt;/p&gt;

&lt;p&gt;Response (Windows) (note the data field with &quot;Test test test&quot;):&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[2023-08-07 14:21:09:246 WARN] Web response body of unsupported content-type &apos;application/json&apos; is being treated as &apos;text/plain&apos;
[2023-08-07 14:21:09:280 INFO] [Scripting] Status: 200

[2023-08-07 14:21:09:282 INFO] [Scripting] Headers: [[&quot;access-control-allow-origin&quot;,&quot;*&quot;],[&quot;access-control-allow-credentials&quot;,&quot;true&quot;],[&quot;date&quot;,&quot;Mon, 07 Aug 2023 21:21:08 GMT&quot;],[&quot;connection&quot;,&quot;keep-alive&quot;],[&quot;content-type&quot;,&quot;application/json&quot;],[&quot;content-length&quot;,&quot;398&quot;],[&quot;server&quot;,&quot;gunicorn/19.9.0&quot;]]

[2023-08-07 14:21:09:285 INFO] [Scripting] Body: {
  &quot;args&quot;: {},
  &quot;data&quot;: &quot;Test test test.&quot;,
  &quot;files&quot;: {},
  &quot;form&quot;: {},
  &quot;headers&quot;: {
    &quot;Content-Length&quot;: &quot;15&quot;,
    &quot;Host&quot;: &quot;httpbin.org&quot;,
    &quot;User-Agent&quot;: &quot;libhttpclient/1.0.0.0&quot;,
    &quot;X-Amzn-Trace-Id&quot;: &quot;Root=1-64d16044-1c5754f16c0b822c13e4e88c&quot;,
    &quot;X-Custom&quot;: &quot;foo&quot;
  },
  &quot;json&quot;: null,
  &quot;method&quot;: &quot;GET&quot;,
  &quot;origin&quot;: &quot;&amp;lt;REDACTED&amp;gt;&quot;,
  &quot;url&quot;: &quot;http://httpbin.org/anything&quot;
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Response Linux (note the empty data field):&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[2023-08-07 21:40:31:341 WARN] Web response body of unsupported content-type &apos;application/json&apos; is being treated as &apos;text/plain&apos;
[2023-08-07 21:40:31:376 INFO] [Scripting] Status: 200

[2023-08-07 21:40:31:377 INFO] [Scripting] Headers: [[&quot;server&quot;,&quot;gunicorn/19.9.0&quot;],[&quot;date&quot;,&quot;Mon, 07 Aug 2023 21:40:31 GMT&quot;],[&quot;content-type&quot;,&quot;application/json&quot;],[&quot;connection&quot;,&quot;keep-alive&quot;],[&quot;content-length&quot;,&quot;378&quot;],[&quot;access-control-allow-origin&quot;,&quot;*&quot;],[&quot;access-control-allow-credentials&quot;,&quot;true&quot;]]

[2023-08-07 21:40:31:377 INFO] [Scripting] Body: {
  &quot;args&quot;: {},
  &quot;data&quot;: &quot;&quot;,
  &quot;files&quot;: {},
  &quot;form&quot;: {},
  &quot;headers&quot;: {
    &quot;Accept&quot;: &quot;*/*&quot;,
    &quot;Host&quot;: &quot;httpbin.org&quot;,
    &quot;User-Agent&quot;: &quot;libhttpclient/1.0.0.0&quot;,
    &quot;X-Amzn-Trace-Id&quot;: &quot;Root=1-64d164cf-488979347ad6527362eca3f5&quot;,
    &quot;X-Custom&quot;: &quot;foo&quot;
  },
&quot;json&quot;: null,
&quot;method&quot;: &quot;GET&quot;,
&quot;origin&quot;: &quot;&amp;lt;REDACTED&amp;gt;&quot;,
&quot;url&quot;: &quot;http://httpbin.org/anything&quot;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Expected behavior here is that the two platforms should operate the same, either both allowing GET requests to have attached bodies, or for neither to allow bodies and to explicitly throw an exception when set.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                <customfield id="customfield_10500" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Confirmation Status</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10300"><![CDATA[Unconfirmed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12700" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Description</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>[Briefly describe the bug here]&lt;br/&gt;
&lt;br/&gt;
*Steps to Reproduce:*&lt;br/&gt;
# [Step 1]&lt;br/&gt;
# [Step 2]&lt;br/&gt;
# [Step 3]&lt;br/&gt;
&lt;br/&gt;
*Observed Results:*&lt;br/&gt;
[Describe what happens]&lt;br/&gt;
&lt;br/&gt;
*Expected Results:*&lt;br/&gt;
[Describe what should happen]&lt;br/&gt;
&lt;br/&gt;
*Screenshots/Videos attached:* [please attach an image or short video]&lt;br/&gt;
&lt;br/&gt;
*Notes:*</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11700" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_11100" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Linked</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_11300" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>Operating System Version</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Linux</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_11600" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i2emtb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    </customfields>
    </item>
</channel>
</rss>