}
}
+static int str_to_bool(const char *s, int def_val)
+{
+ if (!s)
+ return def_val;
+
+ return (strcasecmp(s, "on") == 0 ||
+ strcasecmp(s, "yes") == 0 ||
+ strcasecmp(s, "1"));
+}
+
void RGWHandler_REST::provider_init_state()
{
s->path_name = FCGX_GetParam("SCRIPT_NAME", s->fcgx->envp);
s->http_auth = FCGX_GetParam("HTTP_AUTHORIZATION", s->fcgx->envp);
const char *cgi_env_continue = FCGX_GetParam("RGW_PRINT_CONTINUE", s->fcgx->envp);
- if (cgi_env_continue != NULL && strcasecmp(cgi_env_continue, "On") == 0) {
+ if (str_to_bool(cgi_env_continue, 0)) {
const char *expect = FCGX_GetParam("HTTP_EXPECT", s->fcgx->envp);
s->expect_cont = (expect && !strcasecmp(expect, "100-continue"));
}