Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
shooter27

Remove host and port from Response header lcoation

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);

 

Recommended Posts

Posted · Original PosterOP

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 post
Share on other sites
Posted · Original PosterOP · Best Answer
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 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


×