/*
* Copyright (c) 2015-2024 Free Software Foundation, Inc.
*
* This file is part of Wget
*
* Wget is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Wget is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Wget If not, see .
*
*
* Testing Redirections
*
* Changelog
* 20.10.2015 Tim Ruehsen created
*
*/
#include
#include // exit()
#include "libtest.h"
int main(void)
{
wget_test_url_t urls[]={
{ .name = "/index.html",
.code = "301 Redirect",
.headers = {
"Location: http://localhost:{{port}}/index2.html",
}
},
{ .name = "/index2.html",
.code = "200 Dontcare",
.body = "hello1",
.headers = {
"Content-Type: text/html",
}
},
{ .name = "/301.html",
.code = "301 Redirect",
.headers = {
"Location: /with spaces .html",
}
},
{ .name = "/with spaces .html",
.code = "200 Dontcare",
.body = "hello2",
.headers = {
"Content-Type: text/html",
}
},
{ .name = "/302.html",
.code = "302 Redirect",
.headers = {
"Location: 302_2.html",
}
},
{ .name = "/302_2.html",
.code = "200 Dontcare",
.body = "302307