Polishing contribution
Closes gh-33638
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,7 +24,7 @@ import reactor.netty.http.server.HttpServerRequest;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Helper class for creating a {@link URI} from a reactor {@link HttpServerRequest}.
|
||||
* Helper class to create {@link URI} from a Reactor Netty request.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 6.0.8
|
||||
@@ -48,12 +48,16 @@ abstract class ReactorUriHelper {
|
||||
builder.append(port);
|
||||
}
|
||||
|
||||
// Reactor Netty has config whether to extract and apply forwarded headers.
|
||||
// We apply the prefix manually as it affects the contextPath too.
|
||||
|
||||
String prefix = request.forwardedPrefix();
|
||||
if (prefix != null && !prefix.isEmpty()) {
|
||||
builder.append(prefix);
|
||||
}
|
||||
|
||||
appendRequestUri(request, builder);
|
||||
|
||||
return new URI(builder.toString());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user