๐ (issues): Accept form descriptions longer than 2 KB
Changes
2 files changed, +32 -0
MODIFY
src/main/resources/application.properties
+4 -0
@@ -44,6 +44,10 @@
44
44
quarkus.oidc.authentication.force-redirect-https-scheme=true
45
45
%dev,test.quarkus.oidc.authentication.force-redirect-https-scheme=false
46
46
47
+# Issue/MR descriptions and review comments are posted as single form fields; the Vert.x default
48
+# per-attribute cap of 2 KB answered 413 for anything longer than a short paragraph.
49
+quarkus.http.limits.max-form-attribute-size=256K
50
+
47
51
# Dev-only convenience (see DevDataSeeder / UserProvisioningService):
48
52
# - seed-data: on dev startup, create user alice + a public "demo" repo with one commit (idempotent).
49
53
# - adopt-username: let a login adopt the seeded same-username row even though Keycloak Dev Services
MODIFY
src/test/java/de/workaround/web/IssueUiTest.java
+28 -0
@@ -254,6 +254,34 @@
254
254
}
255
255
256
256
@Test
257
+ @TestSecurity(user = "iss-long")
258
+ void longDescriptionsSurviveCreateAndEdit()
259
+ {
260
+ User owner = persistUser("iss-long");
261
+ Repository repo = service.create(owner, "longdesc", Repository.Visibility.PUBLIC, null);
262
+ String base = "/repos/" + owner.username + "/longdesc/issues";
263
+ // well past the 2 KB Vert.x default form-attribute limit that used to answer 413
264
+ String longBody = "A meaningful line of markdown text.\n".repeat(300);
265
+
266
+ String location = given().redirects().follow(false)
267
+ .contentType("application/x-www-form-urlencoded")
268
+ .formParam("title", "Long story").formParam("description", longBody)
269
+ .when().post(base)
270
+ .then().statusCode(303)
271
+ .extract().header("Location");
272
+
273
+ given().redirects().follow(false)
274
+ .contentType("application/x-www-form-urlencoded")
275
+ .formParam("title", "Long story").formParam("description", longBody + "\nEdited.")
276
+ .when().post(location + "/edit")
277
+ .then().statusCode(303);
278
+
279
+ given().when().get(location)
280
+ .then().statusCode(200)
281
+ .body(containsString("Edited."));
282
+ }
283
+
284
+ @Test
257
285
void anonymousCannotEditIssues()
258
286
{
259
287
User owner = persistUser("iss-edit2-" + UUID.randomUUID().toString().substring(0, 8));