-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing WEB UI only downloads an html template but does not display it #21363
Comments
Do you have |
Yes |
Yes. Such problem usually happen when it's not present. But it also could be a corrupted mime database. Try to regenerate it:
(Need to be run as root.) |
Ok I ran that as root (no output). Would I need to restart qBittorrent to see if it worked? So far it's the same result. |
I would say even reboot to be sure. If it won't help, well, I have no other ideas for now. |
I rebooted but the result is the same when using IP:Port (downloads template without the variables replaced) |
Maybe you'll find something useful in #15316. |
Indeed that is a duplicate, or rather, mine is recurrence of that issue: #15316 I have no idea what mimes have got to do with it but this did get it working: #!/bin/bash
# Navigate to the mime packages directory
cd ~/.local/share/mime/packages
# Search for files referencing 'x-extension-html'
files=$(grep -l 'x-extension-html' *)
# If files are found, remove them
if [ -n "$files" ]; then
echo "Removing files referencing 'x-extension-html':"
echo "$files"
rm $files
else
echo "No files referencing 'x-extension-html' found."
fi
# Update the mime database
update-mime-database ~/.local/share/mime |
Close? |
I mean... this seems like something qBittorrent should check and correct since it breaks a function of qBittorrent so I wouldn't close it only with the workaround in mind. It's a 'solution' to the problem but the root cause of the bug is unknown and not addressed. |
The root of the problem is corrupted/misconfigured mime database, isn't it? |
No it should not. That's not a qBittorent bug. In fact, that's not a bug at all. Such configuration could be intentional, maybe user wants to override how html works in their system. The client should not make such decisions and tweak random stuff in the system without asking the user. And from technical side, there are endless ways users can bork their systems, we can't account for everything anyway. P.S. My systems don't even have |
What I can tell you is that on 4.5.5 the web UI was working. After updating, it wasn't. Why did that happen? Anybody's guess. I have no idea what If you both think it's not a bug, you would know better but to me it seems like there's room for improvement here. The system shouldn't be able to adversely affect an otherwise functional qBittorrent installation. |
qBittorrent always worked that way. As you can see, #15316 is from 2021 (something around 4.3.x version).
qBittorent does not control that behavior in any way. |
@glassez, do you think we should circumvent the mime database? qBittorrent/src/webui/webapplication.cpp Line 576 in a23f45c
At least hardcoding a few well known mime types (say We are not a generic web server after all. |
Agree. |
There are alternative WebUIs though, where we can't know everything ahead of time. |
Sorry, what's the problem? From your suggestion:
|
I meant that we could do it for all the types used by built-in WebUI, besides the ones you listed above. |
No problem. I thought you mean to hardcode everything and drop the mime database completely. Btw, arguably first part of this function should be removed: Lines 184 to 194 in a23f45c
|
"Types used by built-in WebUI" doesn't sound like "everything", IMO. It's strange that you interpreted it that way. |
It's a bad idea to suggest removing the code without knowing its purpose... |
I don't fight against using mime database. IMO, it's a good idea to use things like this. |
Why do you think I would suggest to remove the code without knowing its purpose?
Exactly. But we never serve them, so why need the code?
Yes. Some other software redefines mime type for |
I also inspected all uses of |
I'm sorry if it looked rude. You suggested removing this code without any arguments in favor of such action.
As far as I remember, its main place of use is |
Yeah, I've seen that. If you think it's useful, sure.
I think the base implementation implies to be simple. It also removes overhead from accessing the database when it's not needed. |
Agree (in this case). |
qBittorrent & operating system versions
qBittorrent: 4.6.7 x64
Operating system: Ubuntu 24.04.1 LTS
Qt: 5.15.13
libtorrent-rasterbar: 2.0.11
What is the problem?
I upgraded from 4.5.5 to 4.6.7 and the Web UI was working before the upgrade. Now, when attempting to access the IP:Port, the browser (Firefox or Chrome) prompt to download a file instead of displaying the contents.
Steps to reproduce
Access the Web UI in a browser
Additional context
This is the contents of the downloaded file:
The text was updated successfully, but these errors were encountered: