ausocean / ausocean/cloud

DataBlue: /poll request can return invalid JSON

Open
#706 0 comments 0 reactions 0 assignees View on GitHub
P2
Dominant language
Go
Stars
1
Forks
3
Avg merge
2d 16h
Merged PRs (30d)
6

Description

A request to the datablue /poll endpoint can return invalid JSON in some error conditions.

For example, if the value of a query parameter cannot be parsed as a float value:
```https://data.cloudblue.org/poll?ma=4C:75:25:03:F8:8C&dk=76267409&A0=12a```
This will return the following error:
```{"er":"invalid value"}{"ma":"4C:75:25:03:F8:8C","rc":1,"vs":-617553116}```
Which is not valid JSON.

We should convert datablue to use std library json marshalling for responses to prevent errors like this and make the handlers more readable and configurable.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.