diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2012-07-21 13:12:51 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2012-07-21 13:12:51 +0100 |
commit | a2dadbbe1261ec89fc6b05f356baef06efdc6df7 (patch) | |
tree | 2cb6c201d50edb55a8a2f74518acf3943caa9ee6 /content/fetchers/about.c | |
parent | 02561162a9f4b3ded49cea72cd23b4b102092db8 (diff) | |
download | netsurf-a2dadbbe1261ec89fc6b05f356baef06efdc6df7.tar.gz netsurf-a2dadbbe1261ec89fc6b05f356baef06efdc6df7.tar.bz2 |
Add about:welcome handler and enable resource:welcome.html.
Diffstat (limited to 'content/fetchers/about.c')
-rw-r--r-- | content/fetchers/about.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/content/fetchers/about.c b/content/fetchers/about.c index eddd77ef0..1330217f9 100644 --- a/content/fetchers/about.c +++ b/content/fetchers/about.c @@ -548,6 +548,21 @@ static bool fetch_about_logo_handler(struct fetch_about_context *ctx) return true; } +static bool fetch_about_welcome_handler(struct fetch_about_context *ctx) +{ + fetch_msg msg; + + /* content is going to return redirect */ + fetch_set_http_code(ctx->fetchh, 302); + + msg.type = FETCH_REDIRECT; + msg.data.redirect = "resource:welcome.html"; + + fetch_about_send_callback(&msg, ctx); + + return true; +} + /* Forward declaration because this handler requires the handler table. */ static bool fetch_about_about_handler(struct fetch_about_context *ctx); @@ -560,13 +575,15 @@ struct about_handlers { }; /** List of about paths and their handlers */ -struct about_handlers about_handler_list[] = { +struct about_handlers about_handler_list[] = { { "credits", SLEN("credits"), NULL, fetch_about_credits_handler, false }, { "licence", SLEN("licence"), NULL, fetch_about_licence_handler, false }, { "license", SLEN("license"), NULL, fetch_about_licence_handler, true }, + { "welcome", SLEN("welcome"), NULL, + fetch_about_welcome_handler, false }, { "config", SLEN("config"), NULL, fetch_about_config_handler, false }, { "Choices", SLEN("Choices"), NULL, @@ -585,7 +602,8 @@ struct about_handlers about_handler_list[] = { fetch_about_blank_handler, true } }; -#define about_handler_list_len (sizeof(about_handler_list) / sizeof(struct about_handlers)) +#define about_handler_list_len (sizeof(about_handler_list) / \ + sizeof(struct about_handlers)) /** * List all the valid about: paths available |