The Wayback Machine - https://web.archive.org/web/20210105063519/https://github.com/playframework/playframework/pull/10543
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

[2.7.x] Let user overwrite limit memory size on form binding #10543

Merged

Conversation

@ignasi35
Copy link
Member

@ignasi35 ignasi35 commented Nov 19, 2020

Improves #10496 to avoiding using a hardcoded memory limit when binding a request to a form.

Supersedes #10534 and #10539

This PR puts together ideas and code previously pushed to #10534 and #10539 with some extra feedback from offline discussions.

@ignasi35 ignasi35 changed the title Let user overwrite limit size take two [2.7.x] Let user overwrite limit memory size on form binding Nov 19, 2020
@ignasi35 ignasi35 mentioned this pull request Nov 19, 2020
@ignasi35 ignasi35 requested a review from octonato Nov 19, 2020
@ignasi35 ignasi35 added this to the 2.7.8 milestone Nov 19, 2020
@@ -738,11 +744,12 @@ trait PlayBodyParsers extends BodyParserUtils {
): BodyParser[A] =
BodyParser { requestHeader =>
import play.core.Execution.Implicits.trampoline
val parser = anyContent(maxLength)
val parser = anyContent(maxLength)
val binding = formBinding(maxLength.getOrElse(DefaultMaxTextLength))

This comment has been minimized.

@ignasi35

ignasi35 Nov 23, 2020
Author Member

val binding = formBinding(maxLength.getOrElse(DefaultMaxTextLength)) is necessary to honour the maxLenght provided on this method.

Copy link
Member

@octonato octonato left a comment

LGTM

Left some minor suggestions on migration page.

ignasi35 and others added 2 commits Nov 19, 2020
@ignasi35 ignasi35 force-pushed the ignasi35:let-user-overwrite-limit-size-take-two branch from 8bba039 to ece858a Nov 23, 2020
@octonato octonato merged commit ff54e28 into playframework:2.7.x Nov 23, 2020
3 checks passed
3 checks passed
Summary 1 rule matches and 1 potential rule
Details
Travis CI - Pull Request Build Passed
Details
typesafe-cla-validator All users have signed the CLA
Details
@octonato octonato deleted the ignasi35:let-user-overwrite-limit-size-take-two branch Nov 23, 2020
@mkurz
Copy link
Member

@mkurz mkurz commented Nov 23, 2020

I didn't follow this pull request, but is this something that should be forward ported to master/2.8.x?

@octonato
Copy link
Member

@octonato octonato commented Nov 23, 2020

yes, we will forward port it.

@mkurz
Copy link
Member

@mkurz mkurz commented Nov 24, 2020

I fixed some typos which sneaked into this pull request: #10547

ignasi35 added a commit to ignasi35/playframework that referenced this pull request Dec 3, 2020
Co-authored-by: Renato Cavalcanti <[email protected]>
Co-authored-by: Will Sargent <[email protected]>
mergify bot pushed a commit that referenced this pull request Dec 7, 2020
Co-authored-by: Renato Cavalcanti <[email protected]>
Co-authored-by: Will Sargent <[email protected]>
(cherry picked from commit cebb701)

# Conflicts:
#	project/BuildSettings.scala
@melezov
Copy link

@melezov melezov commented Dec 10, 2020

Hey peeps, micro feedback that this broke a few hundred of bindings for us, since we've been providing the implicit manually:
image

All good, a simple new implicit resolved this, but in case you want to provide the old signature for backwards compatibility.

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

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.