2019/12/17 21:20:44 http: superfluous response.WriteHeader call from gitea.hashru.nl/dsprenkels/rushlink.(*statusResponseWriter).WriteHeader (router.go:79)
How to reproduce:
1. open web UI
2. drag a firefox tab into it
error:
> no 'file' and no 'shorten' fields given in form
logs:
```
2019/12/17 21:20:44 http: superfluous response.WriteHeader call from gitea.hashru.nl/dsprenkels/rushlink.(*statusResponseWriter).WriteHeader (router.go:79)
```
I guess that iff there is no file to be uploaded (but something else; say a tab) then event.dataTransfer.files will have a zero-value. We should also probably show an error.
Add check
Add a warning message when a non-file is being dropped
How do you drag a tab into another? I cannot seem to be able to reproduce that.
In any case, we likely just have to add a check here: https://gitea.hashru.nl/dsprenkels/rushlink/src/commit/8dce4e8483e09382511eb95ace67c9ba06b62896/assets/js/dragdrop.js#L30-L35
I guess that iff there is no file to be uploaded (but something else; say a tab) then `event.dataTransfer.files` will have a zero-value. We should also probably show an error.
- [ ] Add check
- [ ] Add a warning message when a non-file is being dropped
electricdusk
于 2019-12-18 04:49:32 +01:00 修改标题 dragging a firefox tab into web UI produces fun experience 为 Dragging a firefox tab into web UI produces fun experience
So apparently Chrome does upload a correct form, although with an empty payload for the file field. So I guess that we should check whether the file field is empty, vs being absent.
Ok. When I drag a Firefox tab into Chrome, Chrome requests for me:
```
------WebKitFormBoundaryj3RivR1pQwQwmy90
Content-Disposition: form-data; name="file"; filename=""
Content-Type: application/octet-stream
------WebKitFormBoundaryj3RivR1pQwQwmy90--
```
with these headers:
```txt
content-length: 188
content-type: multipart/form-data; boundary=----WebKitFormBoundaryj3RivR1pQwQwmy90
```
So apparently Chrome *does* upload a correct form, although with an empty payload for the `file` field. So I guess that we should check whether the file field is empty, vs being absent.
How to reproduce:
error:
logs:
How do you drag a tab into another? I cannot seem to be able to reproduce that.
In any case, we likely just have to add a check here:
8dce4e8483/assets/js/dragdrop.js (L30-L35)
I guess that iff there is no file to be uploaded (but something else; say a tab) then
event.dataTransfer.files
will have a zero-value. We should also probably show an error.dragging a firefox tab into web UI produces fun experience为 Dragging a firefox tab into web UI produces fun experienceCan confirm, but only when I use another browser (like Chromium) for rushlink, and drag a Firefox tab to Chromium.
Ok. When I drag a Firefox tab into Chrome, Chrome requests for me:
with these headers:
So apparently Chrome does upload a correct form, although with an empty payload for the
file
field. So I guess that we should check whether the file field is empty, vs being absent.