Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS - Allow changing of User-Agent #2293

Merged
merged 3 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion platform/darwin/src/http_file_source.mm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ void cancel() {
NSURLSessionConfiguration *sessionConfig = MLNNativeNetworkManager.sharedManager.sessionConfiguration;
session = [NSURLSession sessionWithConfiguration:sessionConfig];

userAgent = getUserAgent();
if (sessionConfig.HTTPAdditionalHeaders[@"User-Agent"] == nil) {
userAgent = getUserAgent();
} else {
userAgent = sessionConfig.HTTPAdditionalHeaders[@"User-Agent"];
}

}
}

Expand Down
4 changes: 4 additions & 0 deletions platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C

## main

## 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)).

## 6.3.3

- Fix memory leak in Metal shader compilation ([#2257](https://github.com/maplibre/maplibre-native/pull/2257)).
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.3
6.4.0
Loading