Update user agent from Mapbox to MapLibreNative (#2367)
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
### ✨ Features and improvements
|
||||
|
||||
- Update user agent from Mapbox to MapLibreNative.
|
||||
|
||||
### 🐞 Bug fixes
|
||||
|
||||
## 11.0.0
|
||||
|
||||
@@ -51,10 +51,7 @@ android {
|
||||
targetSdkVersion 33
|
||||
buildConfigField "String", "GIT_REVISION_SHORT", String.format("\"%s\"", getGitRevision())
|
||||
buildConfigField "String", "GIT_REVISION", String.format("\"%s\"", getGitRevision(false))
|
||||
buildConfigField "String", "MAPBOX_SDK_IDENTIFIER", String.format("\"%s\"", "mapbox-maps-android")
|
||||
buildConfigField "String", "MAPBOX_SDK_VERSION", String.format("\"%s\"", project.VERSION_NAME)
|
||||
buildConfigField "String", "MAPBOX_VERSION_STRING", String.format("\"Mapbox/%s\"", project.VERSION_NAME)
|
||||
buildConfigField "String", "MAPBOX_EVENTS_USER_AGENT", String.format("\"mapbox-maps-android/%s\"", project.VERSION_NAME)
|
||||
buildConfigField "String", "MAPLIBRE_VERSION_STRING", String.format("\"MapLibre Native/%s\"", project.VERSION_NAME)
|
||||
consumerProguardFiles 'proguard-rules.pro'
|
||||
|
||||
externalNativeBuild {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class HttpRequestImpl implements HttpRequest {
|
||||
private static final String userAgentString = toHumanReadableAscii(
|
||||
String.format("%s %s (%s) Android/%s (%s)",
|
||||
HttpIdentifier.getIdentifier(),
|
||||
BuildConfig.MAPBOX_VERSION_STRING,
|
||||
BuildConfig.MAPLIBRE_VERSION_STRING,
|
||||
BuildConfig.GIT_REVISION_SHORT,
|
||||
Build.VERSION.SDK_INT,
|
||||
Build.CPU_ABI)
|
||||
|
||||
@@ -158,7 +158,7 @@ NSString *HTTPFileSource::Impl::getUserAgent() const {
|
||||
|
||||
// Avoid %s here because it inserts hidden bidirectional markers on macOS when the system
|
||||
// language is set to a right-to-left language.
|
||||
[userAgentComponents addObject:[NSString stringWithFormat:@"MapboxGL/0.0.0 (%@)",
|
||||
[userAgentComponents addObject:[NSString stringWithFormat:@"MapLibreNative/0.0.0 (%@)",
|
||||
@(mbgl::version::revision)]];
|
||||
|
||||
NSString *systemName = @"Darwin";
|
||||
|
||||
@@ -297,7 +297,7 @@ HTTPRequest::HTTPRequest(HTTPFileSource::Impl *context_, Resource resource_, Fil
|
||||
#else
|
||||
handleError(curl_easy_setopt(handle, CURLOPT_ENCODING, "gzip, deflate"));
|
||||
#endif
|
||||
handleError(curl_easy_setopt(handle, CURLOPT_USERAGENT, "MapboxGL/1.0"));
|
||||
handleError(curl_easy_setopt(handle, CURLOPT_USERAGENT, "MapLibreNative/1.0"));
|
||||
handleError(curl_easy_setopt(handle, CURLOPT_SHARE, context->share));
|
||||
|
||||
// Start requesting the information.
|
||||
|
||||
@@ -4,6 +4,8 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C
|
||||
|
||||
## main
|
||||
|
||||
- Update user agent from Mapbox to MapLibreNative.
|
||||
|
||||
## 6.4.0
|
||||
|
||||
- User-Agent in network requests can now be changed via `MLNNativeNetworkManager.sharedManager.sessionConfiguration` ([#2293](https://github.com/maplibre/maplibre-native/pull/2293)).
|
||||
|
||||
Reference in New Issue
Block a user