localhost redirect changing address to http://[::1]/

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

localhost redirect changing address to http://[::1]/

ryan
Sample Handler in ratpack.groovy:
        get("foo") {
             redirect "/bar"
        }


When I request http://localhost:5050/foo
I am getting redirected to http://[::1]:5050/bar

I'm guessing that i don't have something configured correctly, but I can't find a good (current) example.
Reply | Threaded
Open this post in threaded view
|

Re: localhost redirect changing address to http://[::1]/

beckje01
You are currently being redirected to the address the server is bound to which in your case is the IPv6 version of 127.0.0.1

If you want redirect to use a particular base url you can set the public address in the ratpack.properties

I put this quick example together which sets the redirect as you wanted.  https://github.com/beckje01/ratpack-example-publicAddress