Extra newline after body file doesn't respect Content-type charset
- REST Client Version: 0.25.1
- VSCode Version: 1.99.3
- OS Version: Linux x64 6.14.2-arch1-1
Steps to Reproduce:
- Create the file "document.xml" with utf-16le encoding:
<?xml version="1.0" encoding="utf-16le"?><root><node>value</node></root> - Use this command to send POST request to locally running HTTP server:
POST http://127.0.0.1:8000Content-type: text/xml; charset=UTF-8< ./document.xml - The HTTP server dumps the request headers, hexadecimal view of body received and body as text:
Host: 127.0.0.1:8000User-agent: vscode-restclientContent-type: text/xml; charset=utf-16leContent-length: 163fffe3c003f0078006d006c002000760065007200730069006f006e003d00220031002e0030002200200065006e0063006f00640069006e0067003d0022007500740066002d00310036006c00650022003f003e000a003c0072006f006f0074003e000a0020002000200020003c006e006f00640065003e00760061006c00750065003c002f006e006f00640065003e000a003c002f0072006f006f0074003e000a000a<?xml version="1.0" encoding="utf-16le"?><root><node>value</node></root>�
The last byte of the body is the newline (0x0a - �) which restclient added without respecting the charset specified in Content-type header.
In my case I'm posting a PNG and I get the same behavior, the content-length header is also set one byte larger than the file and a 0a byte is appended to the end.
- VScodium version: 1.100.23258, 557d9224936804f4aeb93625d7a45c97113627e4
- Rest client version: 0.25.1
- OS: Arch linux, liquorix kernel 6.14.7-lqx1-1-lqx
Oh, apparently the version published in the marketplace is not the latest one, open VSX has version 0.26.0 and that works correctly: https://open-vsx.org/extension/humao/rest-client
I am also facing the same issue. 0.25.1 and 0.25.0 version has this issue. Was able to install 0.24.6 and get this issue to be resolved.