X Tutup
Skip to content

DefaultHttpMessageConverters not adding provided configurer #36332

@aegliv

Description

@aegliv

If you take a look at the current DefaultHttpMessageConverters, the code does not seem right:

		void addMessageConvertersListConfigurer(Consumer<List<HttpMessageConverter<?>>> configurer) {
			this.convertersListConfigurer = (this.convertersListConfigurer != null) ?
					this.convertersListConfigurer.andThen(this.convertersListConfigurer) : configurer;
		}

Instead of adding configurer to convertersListConfigurer, convertersListConfigurer adds itself ?!

Enhancements requests
I would have expected configurer to be added in both cases:

		void addMessageConvertersListConfigurer(Consumer<List<HttpMessageConverter<?>>> configurer) {
			this.convertersListConfigurer = (this.convertersListConfigurer != null) ?
					this.convertersListConfigurer.andThen(configurer) : configurer;
		}

P.S: Where seems to be a unit test missing which would have found this bug.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup