diff --git a/src/main/java/org/springframework/hateoas/config/WebClientConfigurer.java b/src/main/java/org/springframework/hateoas/config/WebClientConfigurer.java index e47dba2c..ba45ecce 100644 --- a/src/main/java/org/springframework/hateoas/config/WebClientConfigurer.java +++ b/src/main/java/org/springframework/hateoas/config/WebClientConfigurer.java @@ -1,3 +1,18 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.hateoas.config; import lombok.RequiredArgsConstructor; @@ -7,10 +22,8 @@ import java.util.Collection; import java.util.List; import org.springframework.context.annotation.Configuration; -import org.springframework.core.codec.CharSequenceEncoder; import org.springframework.core.codec.Decoder; import org.springframework.core.codec.Encoder; -import org.springframework.core.codec.StringDecoder; import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType; import org.springframework.http.codec.json.Jackson2JsonDecoder; import org.springframework.http.codec.json.Jackson2JsonEncoder; @@ -52,15 +65,11 @@ public class WebClientConfigurer { decoders.add(new Jackson2JsonDecoder(objectMapper, mimeTypes)); }); - encoders.add(CharSequenceEncoder.allMimeTypes()); - decoders.add(StringDecoder.allMimeTypes()); - return ExchangeStrategies.builder().codecs(clientCodecConfigurer -> { encoders.forEach(encoder -> clientCodecConfigurer.customCodecs().encoder(encoder)); decoders.forEach(decoder -> clientCodecConfigurer.customCodecs().decoder(decoder)); - clientCodecConfigurer.registerDefaults(false); }).build(); }