Project

General

Profile

Bug #24545

WebAPI broken redirects

Added by Dmitrii Torbunov 4 months ago. Updated 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
06/17/2020
Due date:
% Done:

0%

Estimated time:
Duration:

Description

Hello,

I have encountered bug with using WebAPI to retrieve information from the samweb servers. The overall issue loooks like this:
1. WebAPI sends a GET request via http to `samweb.fnal.gov`
2. 'samweb` redirects to the https version and sends a new location in the http header.
3. WebAPI incorrectly parses new location -- the location gets truncated.
4. WebAPI retries GET request using the new incorrectly parsed https location and fails.

The log of the connection is attached.

The issue is caused by a small buffer size WebAPI.cc:443: `_fromsite.getline(buf, 512);` which truncates redirect link at 512 characters.

samweb (4.78 KB) samweb Connection Log Dmitrii Torbunov, 06/17/2020 04:46 PM

History

#1 Updated by Marc Mengel 4 months ago

Actually, in the latest version we should be going straight to https:, and thus
never hit this redirect.

But I'll look at making sure we read the whole redirect in future releases.

#2 Updated by Marc Mengel 4 months ago

change is in 593ee3b4af46
if there's no new line in the Location: read, keep looking...

#3 Updated by Dmitrii Torbunov 4 months ago

Thank you!

Also available in: Atom PDF