3 ms·
You'll want to start by not using string interpolation when you meant to use encodeURIComponent https://github.com/varse-io/varse/blob/c14e3427138d6e70f49cfabf7
by mdaniel 2y ago
You'll want to start by not using string interpolation when you meant to use encodeURIComponent https://github.com/varse-io/varse/blob/c14e3427138d6e70f49cfabf78bd9c53e87ac5dc/sdk/varse-io/src/client.ts#L18 https://github.com/varse-io/varse/blob/c14e3427138d6e70f49cf... They should be ashamed of their docs that don't specify whether axios.get does URL encoding for the user or not, but my strong guess is "not" https://axios-http.com/docs/req_config https://axios-http.com/docs/req_config
Because the unwritten rule of any API is that surely as you always use "foo" someone will want to put the first chapter of War and Peace. If nothing else, some validation for what a variableId can look like would also help consumers not have to read external documentation to know if it's [a-zA-Z0-9] or what. Even the server-side of it isn't illustrative https://github.com/varse-io/varse/blob/c14e3427138d6e70f49cfabf78bd9c53e87ac5dc/server/src/api/variable.ts#L16 https://github.com/varse-io/varse/blob/c14e3427138d6e70f49cf... but hey, maybe the first chapter is actually a legitimate key name for all I know https://github.com/varse-io/varse/blob/c14e3427138d6e70f49cfabf78bd9c53e87ac5dc/server/prisma/schema.prisma#L60 https://github.com/varse-io/varse/blob/c14e3427138d6e70f49cf...
- izakfr 2y agoThe axios point is helpful, thank you for mentioning it. I'll make a bug ticket to fix. Also, we should probably put restrictions the keyname scheme. Ideally, it should be something readable.