Bug #24545
WebAPI broken redirects
0%
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.
History
#1 Updated by Marc Mengel 7 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 7 months ago
change is in 593ee3b4af46
if there's no new line in the Location: read, keep looking...
#3 Updated by Dmitrii Torbunov 7 months ago
Thank you!