-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add missing HTTP status codes to httpresp() #28
Copy link
Copy link
Open
Description
Summary
httpresp() in httpresp.c maps HTTP status codes to reason phrases. Unknown codes fall through to the default case which sends 500 Internal Server Error. This causes CGI modules that send valid but uncommon status codes to have their responses silently replaced with 500.
Missing codes
The following standard HTTP status codes are not supported:
| Code | Reason Phrase | Use case |
|---|---|---|
| 405 | Method Not Allowed | Router sends this for unsupported methods |
| 409 | Conflict | Resource already exists, directory not empty |
| 414 | URI Too Long | Path name exceeds limits |
| 507 | Insufficient Storage | Filesystem full, no inodes |
Impact
mvsMF's USS file API needs 409 (Conflict) for duplicate file/directory detection and 507 for filesystem-full conditions. Currently these are remapped to 400/500 as a workaround, losing semantic precision.
Suggested fix
Add the missing codes to the switch statement in httpresp():
case 405: reason = "Method Not Allowed"; break;
case 409: reason = "Conflict"; break;
case 414: reason = "URI Too Long"; break;
case 507: reason = "Insufficient Storage"; break;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels