Jump to content

Remove host and port from Response header lcoation

shooter27
Go to solution Solved by shooter27,
1 hour ago, shooter27 said:

Hi, 

We're doing a java api and need to return the path to the get of an object we just created in a post request. 

The header location should be /reservations/{reservationNumber}
but It is http://localhost:8181/reservations/{reservationNumber}

We can't figure out how to remove the authority part of the uri (http://localhost:8181) since the .build() add's it automatically...

Any help is appreciated

solved using 

config.property(ServerProperties.LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED, true);

 

Hi, 

We're doing a java api and need to return the path to the get of an object we just created in a post request. 

The header location should be /reservations/{reservationNumber}
but It is http://localhost:8181/reservations/{reservationNumber}

We can't figure out how to remove the authority part of the uri (http://localhost:8181) since the .build() add's it automatically...

Any help is appreciated

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, shooter27 said:

Hi, 

We're doing a java api and need to return the path to the get of an object we just created in a post request. 

The header location should be /reservations/{reservationNumber}
but It is http://localhost:8181/reservations/{reservationNumber}

We can't figure out how to remove the authority part of the uri (http://localhost:8181) since the .build() add's it automatically...

Any help is appreciated

solved using 

config.property(ServerProperties.LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED, true);

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×