Record Class ForwardedHeaderUtils.ForwardedInfo
java.lang.Object
java.lang.Record
org.springframework.web.util.ForwardedHeaderUtils.ForwardedInfo
- Record Components:
uriComponentsBuilder- the request URI adapted with the scheme, host, and port from forwarded header valuesforAddress- the address parsed from the "Forwarded" header "for" or "X-Forwarded-For" value, representing the client, ornullif not presentbyAddress- the address parsed from the "Forwarded" header "by", representing the server, ornullif not present; alwaysnullwhen returned fromForwardedHeaderUtils.parseXForwardedHeaders(URI, HttpHeaders, InetSocketAddress, InetSocketAddress)
- Enclosing class:
ForwardedHeaderUtils
public static record ForwardedHeaderUtils.ForwardedInfo(UriComponentsBuilder uriComponentsBuilder, @Nullable InetSocketAddress forAddress, @Nullable InetSocketAddress byAddress)
extends Record
Container for the combined results of parsing either the "Forwarded"
header or the "X-Forwarded-*" alternative headers.
- Since:
- 6.1.29
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorsConstructorDescriptionForwardedInfo(UriComponentsBuilder uriComponentsBuilder, @Nullable InetSocketAddress forAddress, @Nullable InetSocketAddress byAddress) Creates an instance of aForwardedInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebyAddressrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theforAddressrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.uri()Return aURIinitialized fromuriComponentsBuilder().Returns the value of theuriComponentsBuilderrecord component.
-
Constructor Details
-
ForwardedInfo
public ForwardedInfo(UriComponentsBuilder uriComponentsBuilder, @Nullable InetSocketAddress forAddress, @Nullable InetSocketAddress byAddress) Creates an instance of aForwardedInforecord class.- Parameters:
uriComponentsBuilder- the value for theuriComponentsBuilderrecord componentforAddress- the value for theforAddressrecord componentbyAddress- the value for thebyAddressrecord component
-
-
Method Details
-
uri
Return aURIinitialized fromuriComponentsBuilder(). -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
uriComponentsBuilder
Returns the value of theuriComponentsBuilderrecord component.- Returns:
- the value of the
uriComponentsBuilderrecord component
-
forAddress
Returns the value of theforAddressrecord component.- Returns:
- the value of the
forAddressrecord component
-
byAddress
-