encode / apistar

The Web API toolkit. 🛠
https://docs.apistar.com
BSD 3-Clause "New" or "Revised" License
5.57k stars 411 forks source link

Passing force_external to reverse_url #592

Closed gduverger closed 6 years ago

gduverger commented 6 years ago

It looks like the force_external keyword argument of werkzeug.routing.MapAdapter.build (http://werkzeug.pocoo.org/docs/0.14/routing/#werkzeug.routing.MapAdapter.build) is not propagated by apistar.server.Router.reverse_url (https://github.com/encode/apistar/blob/master/apistar/server/router.py#L106). Is there another way to get a full canonical external URL in API Star? If not, could the behavior of reverse_url be updated to allow for passing that parameter? Thank you for reading.

tomchristie commented 6 years ago

Not easily no. Flask keeps a global request context, which API Star doesn't have, so there's no way to automatically determine what hostname to use.

gduverger commented 6 years ago

Okay. Thank you for the explanation, Tom.