projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ac0b714
)
If the redirect URL contains characters RFC 3986 doesn't permit, encode them
author
Fabian Keil
<fk@fabiankeil.de>
Sun, 6 Nov 2011 11:45:28 +0000
(11:45 +0000)
committer
Fabian Keil
<fk@fabiankeil.de>
Sun, 6 Nov 2011 11:45:28 +0000
(11:45 +0000)
filters.c
patch
|
blob
|
history
diff --git
a/filters.c
b/filters.c
index
e2f490c
..
3994638
100644
(file)
--- a/
filters.c
+++ b/
filters.c
@@
-1,4
+1,4
@@
-const char filters_rcs[] = "$Id: filters.c,v 1.15
4 2011/10/30 16:22:46
fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.15
5 2011/11/06 11:36:42
fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
@@
-1308,6
+1308,20
@@
struct http_response *redirect_url(struct client_state *csp)
/* Did any redirect action trigger? */
if (new_url)
{
/* Did any redirect action trigger? */
if (new_url)
{
+ if (url_requires_percent_encoding(new_url))
+ {
+ char *encoded_url;
+ log_error(LOG_LEVEL_REDIRECTS, "Percent-encoding redirect URL: %N",
+ strlen(new_url), new_url);
+ encoded_url = percent_encode_url(new_url);
+ freez(new_url);
+ if (encoded_url == NULL)
+ {
+ return cgi_error_memory();
+ }
+ new_url = encoded_url;
+ }
+
if (0 == strcmpic(new_url, csp->http->url))
{
log_error(LOG_LEVEL_ERROR,
if (0 == strcmpic(new_url, csp->http->url))
{
log_error(LOG_LEVEL_ERROR,