Skip to content

Commit

Permalink
CSCEXAM-1398 Encode query parameters in course search
Browse files Browse the repository at this point in the history
  • Loading branch information
lupari committed Dec 18, 2024
1 parent 0c6cfcf commit 5629c1d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/impl/ExternalCourseHandlerImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package impl
import io.ebean.DB
import miscellaneous.config.ConfigReader
import miscellaneous.scala.DbApiHelper
import models._
import models.*
import models.exam.{Course, Grade, GradeScale}
import models.facility.Organisation
import models.user.User
Expand All @@ -18,15 +18,15 @@ import play.api.Logging
import play.api.libs.json.{JsValue, Json}
import play.api.libs.ws.{WSClient, WSResponse}
import play.mvc.Http
import validators.ExternalCourseValidator.{CourseUnitInfo, GradeScale => ExtGradeScale}
import validators.ExternalCourseValidator.{CourseUnitInfo, GradeScale as ExtGradeScale}

import java.net._
import java.net.*
import java.nio.charset.StandardCharsets
import java.text.SimpleDateFormat
import javax.inject.Inject
import scala.collection.immutable.TreeSet
import scala.concurrent.{ExecutionContext, Future}
import scala.jdk.CollectionConverters._
import scala.jdk.CollectionConverters.*

class ExternalCourseHandlerImpl @Inject (
private val wsClient: WSClient,
Expand Down Expand Up @@ -229,7 +229,7 @@ class ExternalCourseHandlerImpl @Inject (
val path = configReader.getString(configPath.getOrElse(""))
if (!path.contains(COURSE_CODE_PLACEHOLDER))
throw new RuntimeException("exam.integration.courseUnitInfo.url is malformed")
val url = path.replace(COURSE_CODE_PLACEHOLDER, courseCode)
val url = path.replace(COURSE_CODE_PLACEHOLDER, URLEncoder.encode(courseCode, StandardCharsets.UTF_8))
URI.create(url).toURL

private def parseUrl(user: User) =
Expand Down

0 comments on commit 5629c1d

Please sign in to comment.