Skip to content

Commit

Permalink
Allow content-type of text/plain
Browse files Browse the repository at this point in the history
We can internally pretend raw types are formatted
as json.
  • Loading branch information
carlgsmith committed Aug 3, 2023
1 parent 6ce3a4c commit 7617a7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fcgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ get_flags (FCGX_Request * r)
param = FCGX_GetParam ("CONTENT_TYPE", r->envp);
if (param)
{
if (g_strcmp0 (param, "application/json") == 0)
/* Some clients will encode raw values as text/plain,
but we can pretend it is json encoded */
if (g_strcmp0 (param, "application/json") == 0 ||
g_strcmp0 (param, "text/plain") == 0)
flags |= FLAGS_CONTENT_JSON;
else if (g_strcmp0 (param, "application/yang-data+json") == 0)
flags |= FLAGS_CONTENT_JSON | FLAGS_RESTCONF;
Expand Down

0 comments on commit 7617a7c

Please sign in to comment.