Skip to content

Commit

Permalink
Merge pull request #11752 from rouault/backport_11740
Browse files Browse the repository at this point in the history
[Backport 3.10] PLMOSAIC: Use a unique user-agent string to isolate usage of driver
  • Loading branch information
rouault authored Jan 29, 2025
2 parents ee26028 + c84a5f2 commit 952ad8c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions frmts/plmosaic/plmosaicdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,16 @@ char **PLMosaicDataset::GetBaseHTTPOptions()

char **papszOptions =
CSLAddString(nullptr, CPLSPrintf("PERSISTENT=PLMOSAIC:%p", this));

/* Ensure the PLMosaic driver uses a unique default user agent to help
* identify usage. */
CPLString osUserAgent = CPLGetConfigOption("GDAL_HTTP_USERAGENT", "");
if (osUserAgent.empty())
papszOptions = CSLAddString(
papszOptions, CPLSPrintf("USERAGENT=PLMosaic Driver GDAL/%d.%d.%d",
GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR,
GDAL_VERSION_REV));

/* Use basic auth, rather than Authorization headers since curl would
* forward it to S3 */
papszOptions =
Expand Down

0 comments on commit 952ad8c

Please sign in to comment.