Small changes
This commit is contained in:
@@ -71,7 +71,7 @@ class HomeController @Inject()(cc: ControllerComponents) extends AbstractControl
|
||||
*/
|
||||
def sameOriginCheck(rh: RequestHeader): Boolean = {
|
||||
rh.headers.get("Origin") match {
|
||||
case Some(originValue) if originMatches(originValue) =>
|
||||
case Some(originValue) if originMatches(originValue, rh.remoteAddress) =>
|
||||
logger.debug(s"originCheck: originValue = $originValue")
|
||||
true
|
||||
|
||||
@@ -88,7 +88,7 @@ class HomeController @Inject()(cc: ControllerComponents) extends AbstractControl
|
||||
/**
|
||||
* Returns true if the value of the Origin header contains an acceptable value.
|
||||
*/
|
||||
def originMatches(origin: String): Boolean = {
|
||||
def originMatches(origin: String, remoteAddress: String): Boolean = {
|
||||
origin.contains("139.59.210.74") || origin.contains("localhost") || origin.contains("localhost:9000") || origin.contains("localhost:19001")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user