FriendsOfSymfony / FOSJsRoutingBundle

A pretty nice way to expose your Symfony routing to client applications.
1.48k stars 261 forks source link

Bugfix when baseurl is missing or empty in json #371

Closed Ousret closed 4 years ago

Ousret commented 4 years ago

Hi 👋,

I am proposing this PR in order to fix bad url generation when using symfony flex, webpack encore and fosjsrouting json generation.

As a project can be hosted with different domain name, it is complicated to hardcode into our sources.

This is a minor change. We are verifying if baseurl exist and is not empty to use it as is, else we use window.location to guide us.

Thank you for this amazing project !

Bye.

tobias-93 commented 4 years ago

Thanks @Ousret