Skip to content

Commit e1832a0

Browse files
authored
Merge pull request #2871 from SwiftPackageIndex/adjust-validator-size
Adjust SPI Manifest validation to let the server do the validation
2 parents 1e13874 + cfec8cf commit e1832a0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/App/Views/ValidateSPIManifest/ValidateSPIManifest+View.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ extension ValidateSPIManifest {
6767
.autofocus(true),
6868
.rows(15),
6969
.text(model.manifest),
70-
// allow more than maxByteSize so we can correctly report on files that are too large
71-
.attribute(named: "maxlength", value: "\(SPIManifest.Manifest.maxByteSize + 100)")
70+
// The limit here is just to stop abuse, the check for size is done on the server.
71+
.attribute(named: "maxlength", value: "500000")
7272
)
7373
),
7474
.button(

Tests/AppTests/__Snapshots__/WebpageSnapshotTests/test_ValidateSPIManifest_show.1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h2 class="trimmed">Validate a Swift Package Index manifest</h2>
7777
<p>Enter the contents of a
7878
<code>.spi.yml</code> file for validation:
7979
</p>
80-
<textarea name="manifest" autofocus rows="15" maxlength="1600">version: 1
80+
<textarea name="manifest" autofocus rows="15" maxlength="500000">version: 1
8181
builder:
8282
configs:
8383
- documentation_targets: [Target1, Target2]</textarea>

0 commit comments

Comments
 (0)