Skip to content

Commit

Permalink
feat: size up image length (onecx#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteenke authored Feb 16, 2024
1 parent 95423fa commit 8b57288
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/main/openapi/onecx-image-internal-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ paths:
required: true
schema:
minimum: 1
maximum: 20000
maximum: 110000
type: integer
- name: refId
in: path
Expand All @@ -38,7 +38,7 @@ paths:
image/*:
schema:
minimum: 1
maximum: 20000
maximum: 110000
type: string
format: binary
responses:
Expand Down Expand Up @@ -73,7 +73,7 @@ paths:
image/*:
schema:
minimum: 1
maximum: 20000
maximum: 110000
type: string
format: binary
"400":
Expand All @@ -93,7 +93,7 @@ paths:
schema:
type: integer
minimum: 1
maximum: 20000
maximum: 110000
- name: refId
in: path
required: true
Expand All @@ -110,7 +110,7 @@ paths:
image/*:
schema:
minimum: 1
maximum: 20000
maximum: 110000
type: string
format: binary
responses:
Expand Down
2 changes: 1 addition & 1 deletion src/main/openapi/onecx-theme-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ paths:
image/*:
schema:
minimum: 1
maximum: 20000
maximum: 110000
type: string
format: binary
404:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void testMaxUploadSize() {

var refId = "themeMaxUpload";

byte[] body = new byte[20001];
byte[] body = new byte[110001];
new Random().nextBytes(body);

var exception = given()
Expand All @@ -277,7 +277,7 @@ void testMaxUploadSize() {

assertThat(exception.getErrorCode()).isEqualTo(CONSTRAINT_VIOLATIONS.name());
assertThat(exception.getDetail()).isEqualTo(
"uploadImage.contentLength: must be less than or equal to 20000");
"uploadImage.contentLength: must be less than or equal to 110000");

}
}

0 comments on commit 8b57288

Please sign in to comment.