Small changes

This commit is contained in:
Viktor Kholodov
2021-05-05 23:14:08 +03:00
parent e702bd61b4
commit 53941abebd
11 changed files with 131 additions and 177 deletions
+2 -2
View File
@@ -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")
}