Skip to content

Enable port number directly type in and fix http request bug#18

Closed
lawrencehj wants to merge 2 commits intoHardwareMonitor:masterfrom
lawrencehj:master
Closed

Enable port number directly type in and fix http request bug#18
lawrencehj wants to merge 2 commits intoHardwareMonitor:masterfrom
lawrencehj:master

Conversation

@lawrencehj
Copy link
Copy Markdown

  1. The port number up/down control was limited by minimum number of 8080, so when user directly type in the number, it would be corrected to 20000.
  2. If user want to access a sensor with character like '{' or '}' in the id string, the web server can not reponse correcly.
    for example:
    http://127.0.0.1:8088/Sensor?action=Get&id=/nic/%7B3610E5A6-B1A2-46DE-ABCD-CA9D97BDE218%7D/throughput/7

@sergiye
Copy link
Copy Markdown
Collaborator

sergiye commented Mar 30, 2026

thanks for finding bugs, but нour version of fixes isn't entirely correct.

Simply removing the minimum in the port value isn't enough.

The sensor ID needs to be escaped in the request address itself (http://127.0.0.1:8088/Sensor?action=Get&id=/nic/%257B3610E5A6-B1A2-46DE-ABCD-CA9D97BDE218%257D/throughput/7).

But thanks to this, there's now error handling in the HTTP server, and the user will receive a 400 Bad Request error if the request is invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants