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

Send appropriate user agent with geocoding requests #25

Closed
friedbunny opened this issue Feb 18, 2016 · 1 comment
Closed

Send appropriate user agent with geocoding requests #25

friedbunny opened this issue Feb 18, 2016 · 1 comment

Comments

@friedbunny
Copy link
Contributor

Something more distinctive than the default CFNetwork.

I'm not sure it makes sense to try to get the host app's name, but at the very least we can include MBGeocoder in the outgoing user agent.

/cc @1ec5

@1ec5
Copy link
Contributor

1ec5 commented May 29, 2016

This is a bit more complicated than it used to be, now that we use the shared NSURLSession instead of a default NSURLSession. (There’s also an API to get the request URL so clients can perform the request themselves with a custom configuration.) The advantage to using the shared session is that client code doesn’t have to hold a strong reference to MBGeocoder or any other object in order for the callback to get called.

1ec5 added a commit that referenced this issue May 31, 2016
When the Geocoder object sends a request, it sets the User-Agent HTTP header to a value of the form:

	SanDiego/1.2.3 MapboxGeocoder/0.5.0 iOS/9.3.0 (x86_64)

This user agent string is based on the one used by the Mapbox iOS and OS X SDKs.

Fixes #25.
1ec5 added a commit that referenced this issue May 31, 2016
When the Geocoder object sends a request, it sets the User-Agent HTTP header to a value of the form:

	SanDiego/1.2.3 MapboxGeocoder/0.5.0 iOS/9.3.0 (x86_64)

This user agent string is based on the one used by the Mapbox iOS and OS X SDKs.

Fixes #25.
@1ec5 1ec5 closed this as completed in #50 Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants