diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-01-06 14:45:52 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-01-06 14:45:52 -0500 |
commit | c5a43df7d1f50803c3458fc994321defb45fd616 (patch) | |
tree | 790c9f91e1c73734d54ff436a0cfeb308885f0c1 /src/c | |
parent | ef58d6735426a9ab3e6a7643c65926e362f7d157 (diff) |
Basis.currentUrlHasPost
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/request.c | 1 | ||||
-rw-r--r-- | src/c/urweb.c | 14 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/c/request.c b/src/c/request.c index 8e824d8a..b4c3130b 100644 --- a/src/c/request.c +++ b/src/c/request.c @@ -230,6 +230,7 @@ request_result uw_request(uw_request_context rc, uw_context ctx, } is_post = 1; + uw_isPost(ctx); clen_s = uw_Basis_requestHeader(ctx, "Content-type"); if (clen_s && !strncasecmp(clen_s, "multipart/form-data", 19)) { diff --git a/src/c/urweb.c b/src/c/urweb.c index b69fa31e..17e4bed2 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -442,7 +442,7 @@ struct uw_context { void *logger_data; uw_logger log_debug; - int hasPostBody; + int isPost, hasPostBody; uw_Basis_postBody postBody; uw_Basis_string queryString; @@ -508,7 +508,7 @@ uw_context uw_init(void *logger_data, uw_logger log_debug) { ctx->logger_data = logger_data; ctx->log_debug = log_debug; - ctx->hasPostBody = 0; + ctx->isPost = ctx->hasPostBody = 0; ctx->queryString = NULL; @@ -588,7 +588,7 @@ void uw_reset_keep_error_message(uw_context ctx) { ctx->cur_container = NULL; ctx->used_transactionals = 0; ctx->script_header = ""; - ctx->hasPostBody = 0; + ctx->isPost = ctx->hasPostBody = 0; ctx->queryString = NULL; } @@ -3603,6 +3603,14 @@ int uw_hasPostBody(uw_context ctx) { return ctx->hasPostBody; } +void uw_isPost(uw_context ctx) { + ctx->isPost = 1; +} + +uw_Basis_bool uw_Basis_currentUrlHasPost(uw_context ctx) { + return ctx->isPost; +} + void uw_setQueryString(uw_context ctx, uw_Basis_string s) { ctx->queryString = s; } |