summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2013-03-22 11:44:02 +0000
committerolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2013-03-22 11:44:02 +0000
commitdaaa6fae37ad0d92b710cda6926501c05d1cde72 (patch)
tree2ac3e2e3f73cb2387e336398bc2eedad1d9a1980
parent3f8920c4b584f44d18aec2d28de571f5b4b167cf (diff)
downloadmod_auth_mellon-daaa6fae37ad0d92b710cda6926501c05d1cde72.zip
mod_auth_mellon-daaa6fae37ad0d92b710cda6926501c05d1cde72.tar.gz
mod_auth_mellon-daaa6fae37ad0d92b710cda6926501c05d1cde72.tar.xz
Redirect the user when missing repost data.
In the case where we are missing the repost data, we currently display a 400 Bad Request error. This patch changes the code to redirect to the end URL instead, which at least has a chance to work. git-svn-id: https://modmellon.googlecode.com/svn/trunk@202 a716ebb1-153a-0410-b759-cfb97c6a1b53
-rw-r--r--auth_mellon_handler.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/auth_mellon_handler.c b/auth_mellon_handler.c
index 525f712..d78beec 100644
--- a/auth_mellon_handler.c
+++ b/auth_mellon_handler.c
@@ -2375,11 +2375,14 @@ static int am_handle_repost(request_rec *r)
return HTTP_BAD_REQUEST;
}
- psf_filename = apr_psprintf(r->pool, "%s/%s", mod_cfg->post_dir, psf_id);
- if ((post_data = am_getfile(r->pool, r->server, psf_filename)) == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ psf_filename = apr_psprintf(r->pool, "%s/%s", mod_cfg->post_dir, psf_id);
+ post_data = am_getfile(r->pool, r->server, psf_filename);
+ if (post_data == NULL) {
+ /* Unable to load repost data. Just redirect us instead. */
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
"Bad repost query: cannot find \"%s\"", psf_filename);
- return HTTP_BAD_REQUEST;
+ apr_table_setn(r->headers_out, "Location", return_url);
+ return HTTP_SEE_OTHER;
}
if ((post_form = (*post_mkform)(r, post_data)) == NULL) {