mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-10-01 17:51:40 +02:00
16 lines
515 B
Java
16 lines
515 B
Java
package stirling.software.SPDF.utils;
|
|
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
|
|
public class UrlUtils {
|
|
|
|
public static String getOrigin(HttpServletRequest request) {
|
|
String scheme = request.getScheme(); // http or https
|
|
String serverName = request.getServerName(); // localhost
|
|
int serverPort = request.getServerPort(); // 8080
|
|
String contextPath = request.getContextPath(); // /myapp
|
|
|
|
return scheme + "://" + serverName + ":" + serverPort + contextPath;
|
|
}
|
|
}
|