提交 e9819b75 编写于 作者: R Rossen Stoyanchev

Raise ISE if @RequestBody is used for form data

Closes gh-22486
上级 b67039d1
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-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.
......@@ -153,6 +153,11 @@ public abstract class AbstractMessageReaderArgumentResolver extends HandlerMetho
MediaType mediaType = (contentType != null ? contentType : MediaType.APPLICATION_OCTET_STREAM);
Object[] hints = extractValidationHints(bodyParam);
if (mediaType.isCompatibleWith(MediaType.APPLICATION_FORM_URLENCODED)) {
return Mono.error(new IllegalStateException(
"In a WebFlux application, form data is accessed via ServerWebExchange.getFormData()."));
}
if (logger.isDebugEnabled()) {
logger.debug(exchange.getLogPrefix() + (contentType != null ?
"Content-Type:" + contentType :
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册