Dragging a firefox tab into web UI produces fun experience #33

Open
opened 2019-12-17 15:22:13 +01:00 by yorick · 3 comments

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)
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) ```
electricdusk added the
bug
label 2019-12-17 18:41:18 +01:00
Owner

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.

  • 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 changed title from dragging a firefox tab into web UI produces fun experience to Dragging a firefox tab into web UI produces fun experience 2019-12-18 04:49:32 +01:00
Collaborator

Can confirm, but only when I use another browser (like Chromium) for rushlink, and drag a Firefox tab to Chromium.

Can confirm, but only when I use another browser (like Chromium) for rushlink, and drag a Firefox tab to Chromium.
Owner

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:

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.

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.
Sign in to join this conversation.
No Milestone
No Assignees
3 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#33
No description provided.