Skip to content

Commit 3dd8aeb

Browse files
authored
Merge pull request #2512 from constantine2nd/develop
Check mandatory headers of Berlin Group
2 parents 65bbd80 + 274c2d8 commit 3dd8aeb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

obp-api/src/main/scala/code/api/util/BerlinGroupCheck.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ object BerlinGroupCheck {
2020
private def validateHeaders(verb: String, url: String, reqHeaders: List[HTTPParam], forwardResult: (Box[User], Option[CallContext])): (Box[User], Option[CallContext]) = {
2121
val headerMap = reqHeaders.map(h => h.name.toLowerCase -> h).toMap
2222
val missingHeaders = if(url.contains("berlin-group") && url.endsWith("/consent"))
23-
berlinGroupMandatoryHeaders.filterNot(headerMap.contains)
24-
else
2523
(berlinGroupMandatoryHeaders ++ berlinGroupMandatoryHeaderConsent).filterNot(headerMap.contains)
24+
else
25+
berlinGroupMandatoryHeaders.filterNot(headerMap.contains)
2626

2727
if (missingHeaders.isEmpty) {
2828
forwardResult // All mandatory headers are present

obp-api/src/test/scala/code/setup/ServerSetup.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ trait ServerSetup extends FeatureSpec with SendServerRequests
5757
setPropsValues("api_instance_id" -> "1_final")
5858
setPropsValues("starConnector_supported_types" -> "mapped,internal")
5959
setPropsValues("connector" -> "star")
60+
61+
// Berlin Group
62+
setPropsValues("berlin_group_mandatory_headers" -> "")
63+
setPropsValues("berlin_group_mandatory_header_consent" -> "")
6064

6165
val server = TestServer
6266
def baseRequest = host(server.host, server.port)

0 commit comments

Comments
 (0)