-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Delete static methos from WebSecurity
- Loading branch information
1 parent
5e502e7
commit 2f77434
Showing
5 changed files
with
33 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
....engine/src/main/java/org/integratedmodelling/klab/engine/rest/utils/EngineHttpUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.integratedmodelling.klab.engine.rest.utils; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.web.context.request.RequestAttributes; | ||
import org.springframework.web.context.request.RequestContextHolder; | ||
import org.springframework.web.context.request.ServletRequestAttributes; | ||
|
||
public class EngineHttpUtils { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(EngineHttpUtils.class); | ||
|
||
public static HttpServletRequest getCurrentHttpRequest() { | ||
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); | ||
if (requestAttributes instanceof ServletRequestAttributes) { | ||
HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest(); | ||
return request; | ||
} | ||
logger.debug("Not called in the context of an HTTP request"); | ||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters