Project

General

Profile

Actions

Bug #14009

open
EP ED

Http::Client not handling redirect (302) on ssl stream truncated error

Bug #14009: Http::Client not handling redirect (302) on ssl stream truncated error

Added by Emeric Poupon about 1 year ago. Updated about 13 hours ago.

Status:
Review
Priority:
Normal
Target version:
Start date:
09/25/2025
Due date:
% Done:

0%

Estimated time:

Description

Hello,

I have setup a Wt::Http::Client using setFollowRedirect(true).
However, the done callback is called without following the redirection:

MyCallbackClientDone(Wt::AsioWrapper::error_code ec, const Wt::Http::Message& msg)
{
    std::cout << "Client done. ec = " << ec.category().name() << " - " << ec.message() << " (" << ec.value() << "), status = " << msg.status();
}

=>

Client done. ec = asio.ssl.stream - stream truncated (1), status = 302

According to Wt's Client::handleRedirect, it is likely we don't enter the if because of !err

  if (!err && (((status == STATUS_MOVED_PERMANENTLY ||
                 status == STATUS_FOUND ||
                 status == STATUS_TEMPORARY_REDIRECT) && method == Http::Method::Get) ||

What do you think? Is there any workaround?

EP Updated by Emeric Poupon 19 days ago Actions #1

Hello!

Do you have some news about this issue? Some of my users keep reporting it to me...

RM Updated by Romain Mardulyn 13 days ago Actions #2

  • Status changed from New to InProgress
  • Assignee set to Romain Mardulyn
  • Target version set to 4.15.0

RM Updated by Romain Mardulyn 13 days ago ยท Edited Actions #3

Hi Emeric,

I do indeed see no reason to stop the redirection due to a stream_truncated error here. There is no reason to care about the body of the request, and if the response was truncated before the end of the headers, the headers would not be parsed, so the redirecting is already prevented in that case anyway.

As for any workaround, I do not see any. The change needs to happen in Wt.

RM Updated by Romain Mardulyn 13 days ago Actions #4

  • Status changed from InProgress to Review
  • Assignee deleted (Romain Mardulyn)

RM Updated by Romain Mardulyn about 16 hours ago Actions #5

  • Target version changed from 4.15.0 to 4.16.0

RM Updated by Romain Mardulyn about 16 hours ago Actions #6

  • Target version changed from 4.16.0 to 4.15.0

ED Updated by emil de keyser about 13 hours ago Actions #7

  • Assignee set to emil de keyser
Actions

Also available in: PDF Atom