Skip to content

feat: add missing HTTP status codes to httpresp() #28

@mgrossmann

Description

@mgrossmann

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions