From 65d1bdae03299d81eb42418080998e3267e4be6d Mon Sep 17 00:00:00 2001 From: kristenhaerum Date: Thu, 11 Jan 2024 13:57:08 +0100 Subject: [PATCH] URLEncoder igjen #deploy-tenor-search-service --- .../consumers/command/GetTenorTestdata.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/command/GetTenorTestdata.java b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/command/GetTenorTestdata.java index 87971e663ce..0534aec691d 100644 --- a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/command/GetTenorTestdata.java +++ b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/command/GetTenorTestdata.java @@ -6,7 +6,6 @@ import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; import reactor.util.retry.Retry; @@ -30,10 +29,9 @@ public Mono call() { return webClient.get() .uri(uriBuilder -> uriBuilder.path(TENOR_QUERY_URL) - .queryParam("kql", query) + .queryParam("kql", URLEncoder.encode(query, StandardCharsets.UTF_8)) .queryParam("nokkelinformasjon", true) .build()) - .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) .retrieve() .bodyToMono(JsonNode.class)