/*
* Figure out if the type is supported by one of the decoders.
*/
- switch (http_body_type_supported[ctx->type]) {
+ if (ctx->force_to != HTTP_BODY_UNKNOWN) {
+ RDEBUG3("Forcing body type to \"%s\"",
+ fr_int2str(http_body_type_table, ctx->force_to, "<INVALID>"));
+ ctx->type = ctx->force_to;
+ /*
+ * Assume the force_to value has already been validation.
+ */
+ } else switch (http_body_type_supported[ctx->type]) {
case HTTP_BODY_UNSUPPORTED:
REDEBUG("Type \"%s\" is currently unsupported",
fr_int2str(http_body_type_table, ctx->type, "<INVALID>"));
}
/*
+ * Force parsing the body text as a particular encoding.
+ */
+ ctx->response.force_to = section->force_to;
+
+ /*
* If were not doing chunked encoding then we read the entire
* body into a buffer, and send it in one go.
*/
char *body_str;
http_body_type_t body;
+ http_body_type_t force_to;
char *username;
char *password;
int code; //!< HTTP Status Code.
http_body_type_t type; //!< HTTP Content Type.
+ http_body_type_t force_to; //!< Force decoding the body type as a particular encoding.
} rlm_rest_response_t;
/*