use https if a key is provided

If a user provides a key to the api, the endpoint must be https.
Oh you're totally right. Very good then.
On Oct 21, 2014 12:28 PM, "Gilles De Mey" <notifications@github.com> wrote:

> In providers/google.js:
>
> > @@ -17,9 +17,10 @@ exports.geocode = function ( providerOpts, loc, cbk, opts ) {
> >  exports.reverseGeocode = function ( providerOpts, lat, lng, cbk, opts ) {
> >
> >    var options = _.extend({sensor: false, latlng: lat + ',' + lng}, opts || {});
> > +  var uri = "http" + ( options.key ? "s" : "" ) + "://maps.googleapis.com/maps/api/geocode/json"
>
> Why should it be renamed to https?
>
> Supplying the querystring "key" should automatically switch to the https
> protocol, so it's transparent to the user and is still compatible with
> Google's API.
>
> Then document that you can supply a "key" option that will send your
> Google API key along with the request (and switch to https internally).
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/wyattdanger/geocoder/pull/10/files#r19172807>.
>