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

开启中
yorick2019-12-17 15:22:13 +01:00创建 · 3 评论

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) ```
electricdusk2019-12-17 18:41:18 +01:00 添加了标签
bug
管理员

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
electricdusk2019-12-18 04:49:32 +01:00 修改标题 dragging a firefox tab into web UI produces fun experienceDragging a firefox tab into web UI produces fun experience
协作者

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.
管理员

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.
登录 并参与到对话中。
3 名参与者
通知
到期时间
未设置到期时间。
依赖工单

没有设置依赖项。

参考:electricdusk/rushlink#33
没有提供说明。