Error with 400 Bad Request when both 'file' and 'shorten' set #65

Merged
electricdusk merged 2 commits from issue-56 into master 2020-07-06 17:14:40 +02:00
Owner

This patch refactors rushlink.newPasteHandler and adds a check that at most one of the fields file and shorten is set.

For some reason, the Go multipart form API populates the form with duplicate values, when only a single one is provided by the client. So we cannot check if (for example) only one shorten was provided. In this case, I chose to select the first one.

Fixes #56.

This patch refactors `rushlink.newPasteHandler` and adds a check that at most one of the fields `file` and `shorten` is set. For some reason, the Go multipart form API populates the form with duplicate values, when only a single one is provided by the client. So we cannot check if (for example) only *one* `shorten` was provided. In this case, I chose to select the first one. Fixes #56.
minnozz was assigned by electricdusk 2020-05-30 18:36:58 +02:00
Author
Owner

I think this patch should be good. Merging without real review.

I think this patch should be good. Merging without real review.
electricdusk closed this pull request 2020-07-06 17:14:40 +02:00
electricdusk deleted branch issue-56 2020-07-06 17:14:51 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: electricdusk/rushlink#65
No description provided.