|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.epmet.modules.test; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.utils.HttpContextUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
@ -13,8 +14,8 @@ public class TestController { |
|
|
|
|
|
|
|
@PostMapping("get-req-info") |
|
|
|
public Result testDomain(HttpServletRequest request) { |
|
|
|
String domain = String.format("%s://%s:%s", request.getHeader("X-Forwarded-Scheme"), request.getServerName(), request.getServerPort()); |
|
|
|
return new Result().ok(domain); |
|
|
|
String requestServerNameAndPort = HttpContextUtils.getRequestServerNameAndPort(); |
|
|
|
return new Result().ok(requestServerNameAndPort); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|