mapbox / geojson-mapnikify

Transform GeoJSON objects into Mapnik XML stylesheets with embedded GeoJSON data and simplestyle-spec-derived styles.
ISC License
38 stars 22 forks source link

Allow one redirect by default #43

Closed rmrice closed 4 years ago

rmrice commented 4 years ago

We want to allow both http and https for requests, so configure agent to do so

This changes the request config to allow up to one redirect by default (in case the request url is shortened and needs to redirect). This can be customized by passing in a custom client config (see readme).

flippmoke commented 4 years ago

Doesn't this creates a new agent per request -- this will effectively create a new connection right?

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.5%) to 80.519% when pulling 6ce358df79dc8d818a2937ef5fb49e83f7c9ab53 on http-or-https into 0fe586c5ea1c0ff02523f8d5f060a737bc5d5c45 on master.

rmrice commented 4 years ago

@flippmoke right 😬 decided to remove configuring an http/https agent. Testing with downstream libraries indicates we don't need it. Now this just updates the request config to allow for one redirect.

edit: ended up adding two agents-- one for http and https. this implementation won't recreate the agent per request but rather use one of the two agents depending on the protocol.