Stray Newline Appended to Comment (Bug?)

utkonos

Active Member
Apr 11, 2022
145
32
33
Is this a bug?

When creating a network using the following API endpoint, a trailing newline is appended somewhere by Proxmox. It is not in the input value string.
POST /api2/json/nodes/{node}/network

Here is the JSON response from this API endpoint which shows the extraneous \n in the comments field.

JSON:
{'bridge_stp': 'off',
 'active': 1,
 'comments': 'LAN: research\n',
 'priority': 11,
 'iface': 'vmbr1000',
 'method': 'manual',
 'bridge_fd': '0',
 'autostart': 1,
 'families': ['inet'],
 'type': 'bridge',
 'bridge_ports': '',
 'method6': 'manual'}
 
The newline is definitely not there in the data. Something between where this string is stored and the API response is appending a newline character that doesn't belong there.

1716757287109.png
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!