Skip to content

Commit

Permalink
Get authority by calling HttpServletRequest#getServerName (#15141)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrlw authored Feb 18, 2025
1 parent dddeb25 commit 437d38c
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.dubbo.rpc.protocol.tri.servlet;

import org.apache.dubbo.remoting.http12.HttpHeaderNames;
import org.apache.dubbo.remoting.http12.HttpHeaders;
import org.apache.dubbo.remoting.http12.h2.Http2Header;

Expand Down Expand Up @@ -55,7 +54,7 @@ public HttpHeaders headers() {
}
headers.add(PseudoHeaderName.METHOD.value(), method());
headers.add(PseudoHeaderName.SCHEME.value(), request.getScheme());
headers.add(PseudoHeaderName.AUTHORITY.value(), request.getHeader(HttpHeaderNames.HOST.getName()));
headers.add(PseudoHeaderName.AUTHORITY.value(), request.getServerName());
headers.add(PseudoHeaderName.PROTOCOL.value(), request.getProtocol());
this.headers = headers;
}
Expand Down

0 comments on commit 437d38c

Please sign in to comment.