scality/Droplet — Issue #90: genurl generates a wrong URL for S3 when the port value is not the default one
Author: cvedel
Created: 2011-10-11 13:57:44+00:00
State: open

The value of the http(s) port, if it is different from the default value, must be included in the generated URL. It cannot be added afterwards because this will invalidate the signature.

Adding the following lines in libdroplet/s3/reqbuilder.c after line 827 (after appending the host name) fixes the problem:
`
if (((1 == req->ctx->use_https) && (req->ctx->port != 443)) ||
((0 == req->ctx->use_https) && (req->ctx->port != 80)))
{
snprintf(str, sizeof(str), ":%d", req->ctx->port);
DPL_APPEND_STR(str);
}
`