mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Call follow-url hook on redirects
In redirect_cache, call the follow-url hook so that scripts can modify URIs in redirects.
This commit is contained in:
parent
56f1b5d834
commit
4eb7827fe5
19
src/cache/cache.c
vendored
19
src/cache/cache.c
vendored
@ -723,6 +723,25 @@ redirect_cache(struct cache_entry *cached, unsigned char *location,
|
|||||||
|
|
||||||
if (!uristring) return NULL;
|
if (!uristring) return NULL;
|
||||||
|
|
||||||
|
#ifdef CONFIG_SCRIPTING
|
||||||
|
{
|
||||||
|
static int follow_url_event_id = EVENT_NONE;
|
||||||
|
|
||||||
|
set_event_id(follow_url_event_id, "follow-url");
|
||||||
|
trigger_event(follow_url_event_id, &uristring, NULL);
|
||||||
|
|
||||||
|
if (!uristring || !*uristring) {
|
||||||
|
mem_free_if(uristring);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME: Compare if uristring and struri(uri) are equal */
|
||||||
|
/* FIXME: When uri->post will no longer be an encoded string (but
|
||||||
|
* hopefully some refcounted object) we will have to assign the post
|
||||||
|
* data object to the translated URI. */
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Only add the post data if the redirect should not use GET method.
|
/* Only add the post data if the redirect should not use GET method.
|
||||||
* This is tied to the HTTP handling of the 303 and (if the
|
* This is tied to the HTTP handling of the 303 and (if the
|
||||||
* protocol.http.bugs.broken_302_redirect is enabled) the 302 status
|
* protocol.http.bugs.broken_302_redirect is enabled) the 302 status
|
||||||
|
Loading…
Reference in New Issue
Block a user