Chocobo1
4ca6de2b54
Revise string literal usage
...
PR #16703 .
3 years ago
Chocobo1
efc04645b7
Use QString literals
...
It covers src/webui and enables `QT_NO_CAST_FROM_ASCII`.
3 years ago
Chocobo1
ab64ee872b
Use QString literals
...
The plan is to define `QT_NO_CAST_FROM_ASCII` eventually.
PR #16561 .
3 years ago
Vladimir Golovnev
dd1bd8ad10
Implement class for handling filesystem paths
...
PR #15915 .
3 years ago
Vladimir Golovnev (Glassez)
399d3ad85a
Replace QStringRef with QStringView
3 years ago
HiFiPhile
f5315d9ba7
Add WebUI reverse proxy source IP resolution ( #15047 )
...
Co-authored-by: qix67
Co-authored-by: HiFiPhile <admin@hifiphile.com>
3 years ago
Vladimir Golovnev (Glassez)
97c7f3bc67
Raise minimum Qt version to 5.14
4 years ago
Chocobo1
ef79546508
Add `connection_speed` to advanced settings
...
Now we follow libtorrent current default value 30.
Closes #6973 .
Also bump WebAPI version.
4 years ago
Vladimir Golovnev (Glassez)
61d2ff359b
Use QRegularExpression instead of deprecated QRegExp
...
Now it follows closely the definition of wildcard for glob patterns.
The backslash (\) character is not an escape char in this context.
In order to match one of the special characters, place it in square
brackets (for example, [?]).
4 years ago
Vladimir Golovnev (Glassez)
c41df9ffbd
Improve coding style
4 years ago
Thomas Piccirello
6e4f49fc57
Always specify Content-Type in Web API error responses
5 years ago
Chocobo1
02c25dbe2a
Move WebUI icons to its own folder
...
After this change: "http://<server>/icons" will point to "src/icons"
folder and "http://<server>/images" points to the real "images" folder
in the relative path.
5 years ago
Chocobo1
be152f45c9
Define and use Http::HeaderMap type
5 years ago
Chocobo1
d57b9be706
Rename function
5 years ago
Chocobo1
74a2168bc1
Define and use a proper HTTP header structure
5 years ago
Chocobo1
957d697aee
Prebuild HTTP headers as much as possible
...
This avoids some branching when building a HTTP response.
5 years ago
Chocobo1
2729c0cb6d
Suppress misleading warning message
...
QString::split() was giving a non-empty QStringList, and
that caused Session::setBannedIPs() to emit misleading warning message.
5 years ago
Chocobo1
bb80b378c1
Add ability to send custom HTTP headers
5 years ago
FranciscoPombal
691d5e5d89
WebUI: Implement "Secure" flag for session cookie
...
Closes #11724 .
Option is enabled by default for users using qBittorrent's built-in HTTPS capabilities. This flag will never be set if qBittorrent is using plain HTTP.
Users using HTTPS reverse proxies, like "qbt <-> (http) <-> proxy <-> (https) <-> user" should override the flag in the proxy in order to set it, if they wish to do so.
5 years ago
Chocobo1
8fe8cbd3d1
Reuse code path in switch cases
5 years ago
Chocobo1
f907328bdc
Add const to class function
5 years ago
Chocobo1
230949ee3b
Cache and reuse detected MIME type
5 years ago
Chocobo1
7a5e883cd2
Revise inline keyword usage
...
And let compiler decide whether to inline functions.
5 years ago
Chocobo1
89124bdcc8
Add WebAPI session timeout settings
...
Raise default timeout to 1 hour.
5 years ago
Chocobo1
e288de7ec1
Forward declare as much as possible
6 years ago
Chocobo1
c6f3da1097
Improve removeIf() to support set types
...
We can now replace QMutable*Iterator by removeIf() which usage is more consistent with other
algorithm functions.
6 years ago
Chocobo1
bd8d70bf60
Refactor HTTP query parsing
6 years ago
Chocobo1
69d29af097
Fix '+' char not decoded to space correctly
...
Closes #10606 .
6 years ago
Chocobo1
375de4f8a6
Replace QMap with QHash when sensible
6 years ago
Chocobo1
49b57904f9
Use a random number for WebUI cache busting
...
Also fetch qbt version info via WebAPI properly.
6 years ago
CzBiX
d254a98662
Always use index.html as default page
6 years ago
sledgehammer999
5c63ad3b95
Raise minimum Qt version to 5.9.0
6 years ago
thalieht
8c944bd4e1
Avoid repeating the return type
6 years ago
thalieht
947c7e1d64
Convert to range-based for loop
6 years ago
Vladimir Golovnev (Glassez)
b0446380c6
Separate URL components before percent-decoding
...
Allow special characters in query string parameters.
Closes #9116 .
6 years ago
Vladimir Golovnev (Glassez)
2ce3aa9731
Drop legacy WebAPI support
6 years ago
Chocobo1
e98d4e874f
Unify translation files loading action
...
Since it is possible alternative WebUI could be coded in languages other than English,
WebUI must be able to load user-provided webui_en.qm.
At least one translated string must exist in order to generate an usable .qm file.
6 years ago
Chocobo1
c1912e17c1
Revise CSP header
...
The majority of the CSP is tuned for built-in WebUI, it may not be
suitable for alternative UI.
Also add QLatin1String to strings. This code path is called repeatedly,
it is worth adding QLatin1String to squeeze out the last bit of
performance.
6 years ago
Chocobo1
7fd30fa90f
Enforce referrer-policy in WebUI
...
This stops leaking private data to other websites via Referrer header.
6 years ago
thalieht
1f36b8b89f
Combine qAsConst() with copyAsConst() to asConst()
6 years ago
thalieht
6b1d26d555
Convert all foreach() to range-based for()
6 years ago
Chocobo1
b79a231d2e
Fix missing words in WebUI
...
This is because Qt translator returns empty string when the translation
is not provided, now we fallback to the original string from source code.
Closes #9868 .
6 years ago
Thomas Piccirello
cd47380b85
Add SameSite attribute to WebUI session cookie
...
This attribute prevents the cookie from being submitted on any cross-site request, strongly limiting CSRF.
Closes #9877 .
6 years ago
Chocobo1
344e47dcfb
Add option for WebUI Host header validation
...
Closes #9743 .
6 years ago
Vladimir Golovnev (Glassez)
f309a5279e
Fix Alternative Web UI to be available
6 years ago
Vladimir Golovnev (Glassez)
c1a4ef1377
Use independent translation for WebUI
6 years ago
Thomas Piccirello
0b6ae68801
Add WebUI search API controller
...
Closes #2495 .
6 years ago
Chocobo1
71dcc76a64
Replace png icons with svg
6 years ago
Chocobo1
e04aae686f
Cache more preference values
...
These values from Preference class are frequently used.
Also group related variables together.
6 years ago
thalieht
456270bbb1
Delete several unused #include
6 years ago