Merge pull request #1397 from Stirling-Tools/pixeebot/drip-2024-06-07-sonar-java/avoid-implicit-public-constructor-s1118

(Sonar) Fixed finding: "Utility classes should not have public constructors"
This commit is contained in:
Anthony Stirling 2024-06-07 09:09:10 +01:00 committed by GitHub
commit 4f5b19edfb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,9 @@ import jakarta.servlet.http.HttpServletRequest;
public class UrlUtils {
private UrlUtils() {
}
public static String getOrigin(HttpServletRequest request) {
String scheme = request.getScheme(); // http or https
String serverName = request.getServerName(); // localhost