Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Drop special handling of 3xx responses #180

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/ne_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1633,15 +1633,6 @@ int ne_end_request(ne_request *req)
ret = fn(req, hk->userdata, &req->status);
}

if (ret == NE_OK && req->status.klass == 3) {
const char *dest;

dest = get_response_header_hv(req, HH_HV_LOCATION, "location");
if (dest) {
ne_set_error(req->session, _("Redirected to %s"), dest);
}
}

/* Close the connection if persistent connections are disabled or
* not supported by the server. */
if (!req->session->flags[NE_SESSFLAG_PERSIST] || !req->can_persist)
Expand Down
7 changes: 7 additions & 0 deletions test/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ static int reason_phrase(void)
return OK;
}

#if 0
/* This feature was added then remoevd, it potentially wasn't safe
* since the location string wasn't cleaned or checked to be a valid
* URI. */
static int redirect_error(void)
{
ne_session *sess;
Expand All @@ -241,6 +245,7 @@ static int redirect_error(void)
ne_session_destroy(sess);
return OK;
}
#endif

static int no_body_304(void)
{
Expand Down Expand Up @@ -2554,7 +2559,9 @@ ne_test tests[] = {
T(retry_408),
T(dont_retry_408),
T(ipv6_literal),
#if 0
T(redirect_error),
#endif
T(targets),
T(NULL)
};
Loading