Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug report - webx3 在构造rundata parameters的时候 如果发现是文件上传就会忽略 请求url上的参数 #25

Open
loyrevel opened this issue Jul 6, 2015 · 3 comments

Comments

@loyrevel
Copy link

loyrevel commented Jul 6, 2015

---ParameterParserImpl 98 行开始

if (requestContext.isAutoUpload() && upload != null) {
// 如果是multipart/*请求,则调用upload service来解析。
isMultipart = upload.isMultipartContent(wrappedRequest);

        if (isMultipart) {
            try {
                parseUpload();
            } catch (UploadSizeLimitExceededException e) {
                add(ParserRequestContext.UPLOAD_FAILED, Boolean.TRUE);
                add(ParserRequestContext.UPLOAD_SIZE_LIMIT_EXCEEDED, Boolean.TRUE);
                log.warn("File upload exceeds the size limit", e);
            } catch (UploadException e) {
                add(ParserRequestContext.UPLOAD_FAILED, Boolean.TRUE);
                log.warn("Upload failed", e);
            }
        }
    }

    // 从request中取参数
    if (!isMultipart) {
        String method = wrappedRequest.getMethod();
@superbaobao
Copy link
Member

这个行为是符合规范的吧?为什么不把参数放在form body中?

发自我的 iPhone

在 2015年7月5日,22:30,萧山 [email protected] 写道:

---ParameterParserImpl 98 行开始

if (requestContext.isAutoUpload() && upload != null) {
// 如果是multipart/*请求,则调用upload service来解析。
isMultipart = upload.isMultipartContent(wrappedRequest);

    if (isMultipart) {
        try {
            parseUpload();
        } catch (UploadSizeLimitExceededException e) {
            add(ParserRequestContext.UPLOAD_FAILED, Boolean.TRUE);
            add(ParserRequestContext.UPLOAD_SIZE_LIMIT_EXCEEDED, Boolean.TRUE);
            log.warn("File upload exceeds the size limit", e);
        } catch (UploadException e) {
            add(ParserRequestContext.UPLOAD_FAILED, Boolean.TRUE);
            log.warn("Upload failed", e);
        }
    }
}

// 从request中取参数
if (!isMultipart) {
    String method = wrappedRequest.getMethod();


Reply to this email directly or view it on GitHub.

@loyrevel
Copy link
Author

loyrevel commented Jul 6, 2015

逻辑上是可以把参数放子啊form body中;
但是webx 里面的rundata 和原生的servlet里面 request 的行为是不一致的;
会带来编码时的理解成本和前后端的沟通成本;
前端认为这个是符合请求规范的

@superbaobao
Copy link
Member

是一致的,你可以去查servlet spec,post请求是不应该包含url参数的,否则在合并参数时会造成不确定性。

发自我的 iPhone

在 2015年7月6日,05:39,萧山 [email protected] 写道:

逻辑上是可以把参数放子啊form body中;
但是webx 里面的rundata 和原生的servlet里面 request 的行为是不一致的;
会带来编码时的理解成本和前后端的沟通成本;
前端认为这个是符合请求规范的


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants