Skip to content

Commit

Permalink
refactor/typo
Browse files Browse the repository at this point in the history
  • Loading branch information
hongwei1 committed Sep 8, 2023
1 parent d5c8f31 commit da8cce9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions obp-api/src/main/scala/code/api/util/APIUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2182,9 +2182,9 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{

def fullBaseUrl(callContext: Option[CallContext]) : String = {
// callContext.map(_.url).getOrElse("") --> eg: /obp/v2.0.0/banks/gh.29.uk/accounts/202309071568
val urlFromRequestArrary = callContext.map(_.url).getOrElse("").split("/") //eg: Array("", obp, v2.0.0, banks, gh.29.uk, accounts, 202309071568)
val urlFromRequestArray = callContext.map(_.url).getOrElse("").split("/") //eg: Array("", obp, v2.0.0, banks, gh.29.uk, accounts, 202309071568)

val apiPathZeroFromRequest = if( urlFromRequestArrary.length>1) urlFromRequestArrary.apply(1) else urlFromRequestArrary.head
val apiPathZeroFromRequest = if( urlFromRequestArray.length>1) urlFromRequestArray.apply(1) else urlFromRequestArray.head

if (apiPathZeroFromRequest != ApiPathZero) throw new Exception("Configured ApiPathZero is not the same as the actual.")

Expand Down

0 comments on commit da8cce9

Please sign in to comment.