request:body():json() crashes when no body passed #160

Closed
opened 2026-03-31 20:03:08 +00:00 by 0riginaln0 · 2 comments
0riginaln0 commented 2026-03-31 20:03:08 +00:00 (Migrated from github.com)

Would it be a better behavior to return an empty table?

ERROR astra::components::http::server::routes: Error executing the route: EOF while parsing a value at line 1 column 0
Would it be a better behavior to return an empty table? ```shell ERROR astra::components::http::server::routes: Error executing the route: EOF while parsing a value at line 1 column 0 ```
ElhamAryanpur commented 2026-05-03 17:07:34 +00:00 (Migrated from github.com)

Thank you! I'll look into this

Thank you! I'll look into this
ElhamAryanpur commented 2026-05-03 21:03:55 +00:00 (Migrated from github.com)

I think this is a valid response. we shouldn't assume a default value if there is no response. The crash is still within lua and can be caught in pcall as far as I tested

I think this is a valid response. we shouldn't assume a default value if there is no response. The crash is still within lua and can be caught in pcall as far as I tested
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ArkForgeLabs/Astra#160
No description provided.