}
gboolean
-zak_cgi_main_is_get (ZakCgiMain *zakcgimain)
+zak_cgi_main_is_request_method (ZakCgiMain *zakcgimain, const gchar *method)
{
gboolean ret;
param = (gchar *)g_hash_table_lookup (ht, "REQUEST_METHOD");
if (param != NULL)
{
- ret = (g_strcmp0 (param, "GET") == 0);
+ ret = (g_strcmp0 (param, method) == 0);
}
return ret;
}
gboolean
-zak_cgi_main_is_post (ZakCgiMain *zakcgimain)
+zak_cgi_main_is_get (ZakCgiMain *zakcgimain)
{
gboolean ret;
- GHashTable *ht;
+ ret = zak_cgi_main_is_request_method (zakcgimain, "GET");
- gchar *param;
+ return ret;
+}
- ret = FALSE;
+gboolean
+zak_cgi_main_is_post (ZakCgiMain *zakcgimain)
+{
+ gboolean ret;
- ht = zak_cgi_main_get_env (zakcgimain);
- param = (gchar *)g_hash_table_lookup (ht, "REQUEST_METHOD");
- if (param != NULL)
- {
- ret = (g_strcmp0 (param, "POST") == 0);
- }
+ ret = zak_cgi_main_is_request_method (zakcgimain, "POST");
return ret;
}
void zak_cgi_main_redirect (const gchar *url);
+gboolean zak_cgi_main_is_request_method (ZakCgiMain *zakcgimain, const gchar *method);
+
gboolean zak_cgi_main_is_get (ZakCgiMain *zakcgimain);
gboolean zak_cgi_main_is_post (ZakCgiMain *zakcgimain);