Skip to content

Commit e7f9596

Browse files
add data limit to simple request
1 parent 1877cd5 commit e7f9596

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/HttpClient_device.zig

+3
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,9 @@ pub const HttpDevice = struct {
432432
pub fn simple_request(self: *HttpDevice, req: SimpleRequest) !void {
433433
const runner_inst = self.runner_loop.runner_instance;
434434
if (self.runner_loop.get_tx_free_space(runner_inst) < 4) return DriverError.TX_BUFFER_FULL;
435+
if (req.data) |has_data| {
436+
if (has_data.len > 230) return HTTPError.DataTooLong;
437+
}
435438
var header_clear: commands.Package = .{};
436439
const clear_slice = std.fmt.bufPrint(&header_clear.str, "{s}{s}=0{s}", .{
437440
PREFIX,

0 commit comments

Comments
 (0)