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 oneshorten was provided. In this case, I chose to select the first one.
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 electricdusk2020-05-30 18:36:58 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This patch refactors
rushlink.newPasteHandlerand adds a check that at most one of the fieldsfileandshortenis 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
shortenwas provided. In this case, I chose to select the first one.Fixes #56.
I think this patch should be good. Merging without real review.