duplicati icon indicating copy to clipboard operation
duplicati copied to clipboard

Frontend should not rely on the status text of the HTTP responses

Open LeonardMeyer opened this issue 2 years ago • 1 comments

  • [x] I have searched open and closed issues for duplicates.
  • [x] I have searched the forum for related topics.

Environment info

  • Duplicati version: 2.0.6.3_beta_2021-06-17
  • Operating system: Ubuntu 20.04
  • Backend: Google Drive, but all of them are possibly implicated

Description

It all started here https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/15 if you want all the details

Basically when you run Duplicati behind a reverse proxy using HTTP/2 (like Caddy), the status text part of the responses (aka reason phrase) gets stripped and replaced. This is expected behavior since HTTP/2 does not support it, and HTTP/1 specs says it's just for human users, not automata. Bottom line is, it shouldn't be used. The problem is the frontend relies on it for its logic (here for example). This means frontend will be malfunctioning for every user running on HTTP/2 or more.

Steps to reproduce

Just put Caddy in front of it I suppose 🤷‍♂️ I experienced the issue here if you want to replicate it in a VM for example (just remove all the non Duplicati stuff in the docker-compose .yml file)

  • Actual result: N/A
  • Expected result: N/A

Screenshots

bug data

Debug log

N/A

LeonardMeyer avatar Jun 01 '22 09:06 LeonardMeyer

This issue has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/unable-to-specify-path-when-using-google-drive/12891/21

duplicatibot avatar Jun 01 '22 09:06 duplicatibot

@LeonardMeyer did you find any resolution on this? happening also in traefik

idanlah avatar Nov 09 '23 19:11 idanlah

This can be fixed pretty easily in a future release, because the error is also sent as JSON data (visible in the screenshot).

@idanlah What is your use case? If you only want to know the reason for an error you get, you can open the Network tab in the browser debugger and look at the response there.

If you absolutely need a fix for this now, you can theoretically even modify the JavaScript files in the install folder to make them work.

Jojo-1000 avatar Nov 09 '23 20:11 Jojo-1000

its the same use case as the OP mentioned. trying to Test Connection in Google Drive doesn't pop up "folder does not exist" window. i can fix it in js but ill need to look for all the places where it can happen, it doesn't happen only in this case.

idanlah avatar Nov 09 '23 20:11 idanlah