Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
Created December 31, 2020 07:57
Show Gist options
  • Save sandipchitale/fcaa01ab8d908a093e8876029481ddbf to your computer and use it in GitHub Desktop.
Save sandipchitale/fcaa01ab8d908a093e8876029481ddbf to your computer and use it in GitHub Desktop.
Build URI compoents from current request considering4 x-forwarded-* headers #springboot
UriComponents uriComponents = UriComponentsBuilder.fromHttpRequest(
new ServletServerHttpRequest(((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest())).build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment