Skip to content

fix: use getContentLengthLong instead getContentLength (#10506) (CP: 2.5)#10540

Merged
pleku merged 1 commit into
2.5from
cherry-pick-10506-to-2.5-1617260713872
Apr 1, 2021
Merged

fix: use getContentLengthLong instead getContentLength (#10506) (CP: 2.5)#10540
pleku merged 1 commit into
2.5from
cherry-pick-10506-to-2.5-1617260713872

Conversation

@vaadin-bot

Copy link
Copy Markdown
Collaborator

No description provided.

Use Servlet 3.1 ServletRequest::getContentLengthLong to get the content size as a long value for the big files upload, because getContentLength may return -1 (file size is bigger than int capacity).

fixes #10392
StateNode owner) throws IOException {
boolean success = true;
long contentLength = request.getContentLength();
long contentLength = getContentLength(request);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Remove this use of "getContentLength"; it is deprecated. rule

* @deprecated use {@link VaadinRequest#getContentLengthLong()} instead
*/
@Deprecated
protected long getContentLength(VaadinRequest request) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INFO Do not forget to remove this deprecated code someday. rule

@vaadin-bot

Copy link
Copy Markdown
Collaborator Author

SonarQube analysis reported 3 issues

  • MINOR 2 minor
  • INFO 1 info

Watch the comments in this conversation to review them.

1 extra issue

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. MINOR StreamReceiverHandler.java#L150: Remove this use of "getContentLength"; it is deprecated. rule

@pleku pleku added +0.0.1 and removed +1.0.0 labels Apr 1, 2021
@pleku pleku merged commit e942bd1 into 2.5 Apr 1, 2021
@pleku pleku deleted the cherry-pick-10506-to-2.5-1617260713872 branch April 1, 2021 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants