<div dir="ltr"><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">Hi Even,</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">Thank you very much for quickly looking into this issue and providing a fix. I appreciate your prompt response and assistance.</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">I’ve tested the with `GDAL 3.10.0dev-58cc577359, released 2024/09/22 (debug build)`, and the following command is now working without any issues:</p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><br></p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">```</p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">gdalinfo --debug on \<br> --config CPL_CURL_VERBOSE YES \<br> --config GDAL_DISABLE_READDIR_ON_OPEN EMPTY_DIR \<br> --config CPL_VSIL_CURL_USE_HEAD NO \<br> --config GDAL_HTTP_HEADERS="Authorization: Bearer xxxx" \<br> /vsicurl/<a href="https://example.com/stac/collections/items/assets?path=s3://your-bucket/red.tif">https://example.com/stac/collections/items/assets?path=s3://your-bucket/red.tif</a><br></p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">```</p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">This has resolved the problem I was encountering with the Authorization header being passed to the redirected pre-signed S3 URLs.</p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br></p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">Thank you again for your help and for the excellent support. Your work is greatly appreciated.</p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br></p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">Best regards,</p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br></p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">Pradeep Gulla</p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><br></p><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><br></p></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Sep 22, 2024 at 5:07 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<p>Hi Pradeep</p>
<p>Can you give a try to <a href="https://github.com/OSGeo/gdal/pull/10857" target="_blank">https://github.com/OSGeo/gdal/pull/10857</a> ?</p>
<p>Even<br>
</p>
<div>Le 22/09/2024 à 07:37, Pradeep kumar
via gdal-dev a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">Dear
GDAL Developers,</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">I
hope this message finds you well.</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">I
am experiencing an issue with GDAL’s VSICURL virtual file
system where the <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header is being passed to redirected pre-signed S3 URLs,
leading to errors when accessing AWS S3.</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><b>Background:</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">In
my use case, I have a proxy URL that, when called with an <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header, validates the token, verifies authorization, and then
generates a pre-signed URL to an S3 object. The proxy then
redirects the client to this pre-signed URL. When using GDAL
with this reverse proxy server and setting the configuration
option <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">--config
CPL_VSIL_CURL_USE_S3_REDIRECT NO</span>, everything works
correctly. However, the issue is that GDAL makes too many
round trips, and each time I end up generating a new
pre-signed URL. Ideally, I would like GDAL to send the initial
request and then reuse the pre-signed URLs for subsequent
requests.</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">This
desired behavior is achieved with <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">--config
CPL_VSIL_CURL_USE_S3_REDIRECT YES</span>. However, the
problem now is that GDAL, on subsequent requests to the
pre-signed URL, is also passing the <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header. I am using the configuration <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">--config
GDAL_HTTP_HEADERS "Authorization: Bearer xxxx"</span> to set
the initial header, so the <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header is being sent with every request.</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">When
the <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header is sent to AWS S3 along with the pre-signed URL, AWS
returns the following error:</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">```Only
one auth mechanism allowed; only the X-Amz-Algorithm query
parameter, Signature query string parameter or the
Authorization header should be specified.```</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><b>Observed
Behavior:</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px 0px 0px 13px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><span style="white-space:pre-wrap"> </span>•<span style="white-space:pre-wrap"> </span><b>First
Request (302 OK):</b> GDAL sends a request to the proxy URL
with the <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header. The proxy validates the token and redirects to the
pre-signed S3 URL. GDAL follows the redirect, and since the
pre-signed URL is accessed without the <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header, AWS S3 responds with a <b>200 OK</b>. This behavior
is as expected.</p>
<p style="margin:0px 0px 0px 13px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><span style="white-space:pre-wrap"> </span>•<span style="white-space:pre-wrap"> </span><b>Subsequent
Requests (400 Bad Request):</b> GDAL reuses the pre-signed
URL but includes the <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header in the request. AWS S3, seeing both the pre-signed
URL’s query parameters and the <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header, returns a <b>400 Bad Request</b> error, stating that
only one authentication mechanism is allowed.</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><b>Expected
Behavior:</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">I
expect that GDAL’s VSICURL should send the initial request
with the <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header to the proxy URL. Upon receiving the redirect to the
pre-signed URL, it should not include the <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header in subsequent requests to AWS S3. This would allow AWS
S3 to accept the pre-signed URL without conflicts.</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><b>Questions:</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px 0px 0px 13px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><span style="white-space:pre-wrap"> </span>•<span style="white-space:pre-wrap"> </span>Is
there a way to configure GDAL so that it does not pass the <span style="font-stretch:normal;line-height:normal;font-family:".AppleSystemUIFontMonospaced";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal">Authorization</span>
header to the redirected pre-signed URLs while retaining it
for the initial request?</p>
<p style="margin:0px 0px 0px 13px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><span style="white-space:pre-wrap"> </span>•<span style="white-space:pre-wrap"> </span>If
this feature is not currently available, would it be feasible
to implement such functionality?</p>
<p style="margin:0px 0px 0px 13px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><span style="white-space:pre-wrap"> </span>•<span style="white-space:pre-wrap"> </span>Are
there any plans to address the handling of HTTP redirect
response codes 301 and 307 in future GDAL releases to better
support this use case?</p>
<p style="margin:0px 0px 0px 13px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><b>GDAL
CLI Command:</b><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><b><br>
</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><b>``` </b><span style="font-family:"Helvetica Neue";font-size:13px;color:rgb(34,34,34)">gdalinfo
--debug on --config CPL_CURL_VERBOSE YES --config
GDAL_DISABLE_READDIR_ON_OPEN EMPTY_DIR --config
CPL_VSIL_CURL_USE_S3_REDIRECT YES --config
GDAL_HTTP_HEADERS="Authorization: Bearer xxxx" /vsicurl/</span><a href="https://example.com/stac/collections/items/assets?path=s3://your-bucket/red.tif" target="_blank">https://example.com/stac/collections/items/assets?path=s3://your-bucket/red.tif</a><span style="font-family:"Helvetica Neue";font-size:13px;color:rgb(34,34,34)"> ```</span></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><b>Example
GDAL Logs:</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">Below
are the GDAL logs illustrating the issue (sensitive
information has been redacted):</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><b>First
Request (200 OK):</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><b>```</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">HTTP:
libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12
nghttp2/1.61.0<br>
HTTP: GDAL was built against curl 8.4.0, but is running
against 8.7.1.<br>
CURL_INFO_TEXT: [HTTP/2] [1] OPENED stream for <a href="https://example.com/stac/collections/items/assets?path=s3://your-bucket/red.tif" target="_blank">https://example.com/stac/collections/items/assets?path=s3://your-bucket/red.tif</a><br>
CURL_INFO_TEXT: [HTTP/2] [1] [:method: HEAD]<br>
CURL_INFO_TEXT: [HTTP/2] [1] [:scheme: https]<br>
CURL_INFO_TEXT: [HTTP/2] [1] [:authority: <a href="http://example.com" target="_blank">example.com</a>]<br>
CURL_INFO_TEXT: [HTTP/2] [1] [:path:
/stac/collections/items/assets/foo?path=s3://your-bucket/red.tif]<br>
CURL_INFO_TEXT: [HTTP/2] [1] [user-agent: GDAL/3.9.2]<br>
CURL_INFO_TEXT: [HTTP/2] [1] [accept: */*]<br>
CURL_INFO_TEXT: [HTTP/2] [1] [authorization: Bearer
[REDACTED]]<br>
CURL_INFO_HEADER_OUT: HEAD
/stac/collections/items/assets/foo?path=s3://your-bucket/red.tif
HTTP/2<br>
Host: <a href="http://example.com" target="_blank">example.com</a><br>
User-Agent: GDAL/3.9.2<br>
Accept: */*<br>
Authorization: Bearer [REDACTED]<br>
<br>
CURL_INFO_TEXT: Request completely sent off<br>
CURL_INFO_HEADER_IN: HTTP/2 301<br>
CURL_INFO_HEADER_IN: date: Sun, 22 Sep 2024 04:44:28 GMT<br>
CURL_INFO_HEADER_IN: content-type: text/plain; charset=utf-8<br>
CURL_INFO_HEADER_IN: content-length: 43<br>
CURL_INFO_HEADER_IN: location: <a href="https://s3-bucket-placeholder/red.tif?response-content-type=image%2Ftiff&AWSAccessKeyId=[REDACTED]&Signature=[REDACTED]&x-amz-security-token=[REDACTED]&Expires=1726983868" target="_blank">https://s3-bucket-placeholder/red.tif?response-content-type=image%2Ftiff&AWSAccessKeyId=[REDACTED]&Signature=[REDACTED]&x-amz-security-token=[REDACTED]&Expires=1726983868</a><br>
CURL_INFO_HEADER_IN: x-content-length: 176995703<br>
CURL_INFO_HEADER_IN: apigw-requestid: [REDACTED]<br>
CURL_INFO_HEADER_IN:<br>
CURL_INFO_TEXT: Ignoring the response-body<br>
CURL_INFO_TEXT: Connection #0 to host <a href="http://example.com" target="_blank">example.com</a>
left intact<br>
CURL_INFO_TEXT: Issue another request to this URL: '<a href="https://s3-bucket-placeholder/red.tif?response-content-type=image%2Ftiff&AWSAccessKeyId=[REDACTED]&Signature=[REDACTED]&x-amz-security-token=[REDACTED]&Expires=1726983868" target="_blank">https://s3-bucket-placeholder/red.tif?response-content-type=image%2Ftiff&AWSAccessKeyId=[REDACTED]&Signature=[REDACTED]&x-amz-security-token=[REDACTED]&Expires=1726983868</a>'<br>
CURL_INFO_TEXT: Couldn't find host s3-bucket-placeholder in
the .netrc file; using defaults<br>
CURL_INFO_TEXT: Host s3-bucket-placeholder:443 was resolved.<br>
CURL_INFO_TEXT: Trying [REDACTED]...<br>
CURL_INFO_TEXT: Connected to s3-bucket-placeholder
([REDACTED]) port 443<br>
CURL_INFO_TEXT: SSL connection using TLSv1.3 / [REDACTED]<br>
CURL_INFO_TEXT: Server certificate:<br>
CURL_INFO_TEXT: subject: CN=*.<a href="http://s3.amazonaws.com" target="_blank">s3.amazonaws.com</a><br>
CURL_INFO_TEXT: start date: Apr 22 00:00:00 2024 GMT<br>
CURL_INFO_TEXT: expire date: Apr 7 23:59:59 2025 GMT<br>
CURL_INFO_TEXT: issuer: C=US; O=Amazon; CN=Amazon RSA 2048
M01<br>
CURL_INFO_TEXT: SSL certificate verify ok.<br>
CURL_INFO_HEADER_OUT: HEAD
/red.tif?response-content-type=image%2Ftiff&AWSAccessKeyId=[REDACTED]&Signature=[REDACTED]&x-amz-security-token=[REDACTED]&Expires=1726983868
HTTP/1.1<br>
Host: s3-bucket-placeholder<br>
User-Agent: GDAL/3.9.2<br>
Accept: */*<br>
<br>
CURL_INFO_TEXT: Request completely sent off<br>
CURL_INFO_HEADER_IN: HTTP/1.1 200 OK<br>
CURL_INFO_HEADER_IN: x-amz-id-2: [REDACTED]<br>
CURL_INFO_HEADER_IN: x-amz-request-id: [REDACTED]<br>
CURL_INFO_HEADER_IN: Date: Sun, 22 Sep 2024 04:44:29 GMT<br>
CURL_INFO_HEADER_IN: Last-Modified: Tue, 17 Sep 2024 17:44:40
GMT<br>
CURL_INFO_HEADER_IN: ETag: "[REDACTED]"<br>
CURL_INFO_HEADER_IN: x-amz-server-side-encryption: AES256<br>
CURL_INFO_HEADER_IN: Accept-Ranges: bytes<br>
CURL_INFO_HEADER_IN: Content-Type: image/tiff<br>
CURL_INFO_HEADER_IN: Server: AmazonS3<br>
CURL_INFO_HEADER_IN: Content-Length: 176995703<br>
CURL_INFO_HEADER_IN:<br>
CURL_INFO_TEXT: Connection #1 to host s3-bucket-placeholder
left intact<br>
VSICURL: Effective URL: <a href="https://s3-bucket-placeholder/red.tif?response-content-type=image%2Ftiff&AWSAccessKeyId=[REDACTED]&Signature=[REDACTED]&x-amz-security-token=[REDACTED]&Expires=1726983868" target="_blank">https://s3-bucket-placeholder/red.tif?response-content-type=image%2Ftiff&AWSAccessKeyId=[REDACTED]&Signature=[REDACTED]&x-amz-security-token=[REDACTED]&Expires=1726983868</a><br>
VSICURL: Will use redirect URL for the next 3599 seconds<br>
VSICURL: GetFileSize(<a href="https://example.com/stac/collections/items/assets/foo?path=s3://your-bucket/red.tif)=176995703" target="_blank">https://example.com/stac/collections/items/assets/foo?path=s3://your-bucket/red.tif)=176995703</a>
response_code=200<b><br>
</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">```</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><b>Subsequent
Request (400 Bad Request):</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><b>```</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">VSICURL:
Using redirect URL as it looks to be still valid (3599 seconds
left)<br>
VSICURL: Downloading 0-16383 (<a href="https://s3-bucket-placeholder/red.tif?response-content-type=image%2Ftiff&AWSAccessKeyId=[REDACTED]&Signature=[REDACTED]&x-amz-security-token=[REDACTED]&Expires=1726983868)." target="_blank">https://s3-bucket-placeholder/red.tif?response-content-type=image%2Ftiff&AWSAccessKeyId=[REDACTED]&Signature=[REDACTED]&x-amz-security-token=[REDACTED]&Expires=1726983868).</a>..<br>
CURL_INFO_TEXT: Couldn't find host s3-bucket-placeholder in
the .netrc file; using defaults<br>
CURL_INFO_TEXT: Found bundle for host: 0x600001aa8270
[serially]<br>
CURL_INFO_TEXT: Can not multiplex, even if we wanted to<br>
CURL_INFO_TEXT: Re-using existing connection with host
s3-bucket-placeholder<br>
CURL_INFO_HEADER_OUT: GET
/red.tif?response-content-type=image%2Ftiff&AWSAccessKeyId=[REDACTED]&Signature=[REDACTED]&x-amz-security-token=[REDACTED]&Expires=1726983868
HTTP/1.1<br>
Host: s3-bucket-placeholder<br>
User-Agent: GDAL/3.9.2<br>
Accept: */*<br>
Authorization: Bearer [REDACTED]<br>
Range: bytes=0-16383<br>
<br>
CURL_INFO_TEXT: Request completely sent off<br>
CURL_INFO_HEADER_IN: HTTP/1.1 400 Bad Request<br>
CURL_INFO_HEADER_IN: x-amz-request-id: [REDACTED]<br>
CURL_INFO_HEADER_IN: x-amz-id-2: [REDACTED]<br>
CURL_INFO_HEADER_IN: Content-Type: application/xml<br>
CURL_INFO_HEADER_IN: Transfer-Encoding: chunked<br>
CURL_INFO_HEADER_IN: Date: Sun, 22 Sep 2024 04:44:28 GMT<br>
CURL_INFO_HEADER_IN: Server: AmazonS3<br>
CURL_INFO_HEADER_IN: Connection: close<br>
CURL_INFO_HEADER_IN:<br>
CURL_INFO_TEXT: Closing connection<br>
VSICURL: Got response_code=400<br>
ERROR 4: `/vsicurl/<a href="https://example.com/stac/collections/items/assets/foo?path=s3://your-bucket/red.tif" target="_blank">https://example.com/stac/collections/items/assets/foo?path=s3://your-bucket/red.tif</a>'
not recognized as being in a supported file format.<br>
gdalinfo failed - unable to open '/vsicurl/<a href="https://example.com/stac/collections/items/assets/foo?path=s3://your-bucket/red.tif" target="_blank">https://example.com/stac/collections/items/assets/foo?path=s3://your-bucket/red.tif</a>'.<b><br>
</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">```</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)"><b>Additional
Information:</b></p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">If
you require any further details or clarification, please let
me know. I would be happy to provide more information.
Additionally, if necessary, I can create an issue on the GDAL
GitHub repository to track this problem.</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14)">Thank
you very much for your time and assistance. I appreciate any
guidance or suggestions you can provide to help resolve this
issue.</p>
<p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:".SF NS";font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal;color:rgb(14,14,14);min-height:17px"><br>
</p>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">Best Regards,
<div>Pradeep Gulla</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Best Regards,<div>Pradeep Gulla</div></div></div>