FIX: Empty tab detection with default User-Agent header
This commit is contained in:
parent
8be6114318
commit
3ab8b0c926
@ -49,7 +49,10 @@ class TabManager:
|
||||
# Make a copy to avoid reference issues
|
||||
# Create original for saved requests or loaded history items (anything with content)
|
||||
# Only skip for truly blank new requests
|
||||
has_content = bool(request.url or request.body or request.headers)
|
||||
# Consider headers empty if they only contain default headers
|
||||
has_only_default_headers = request.headers == HttpRequest.default_headers()
|
||||
has_non_default_headers = request.headers and not has_only_default_headers
|
||||
has_content = bool(request.url or request.body or has_non_default_headers)
|
||||
original_request = HttpRequest(
|
||||
method=request.method,
|
||||
url=request.url,
|
||||
|
||||
@ -301,10 +301,13 @@ class RosterWindow(Adw.ApplicationWindow):
|
||||
|
||||
# Check if it's empty
|
||||
request = widget.get_request()
|
||||
# Consider headers empty if they're either empty or only contain default headers
|
||||
from .models import HttpRequest
|
||||
has_only_default_headers = request.headers == HttpRequest.default_headers()
|
||||
is_empty = (
|
||||
not request.url.strip() and
|
||||
not request.body.strip() and
|
||||
not request.headers
|
||||
(not request.headers or has_only_default_headers)
|
||||
)
|
||||
|
||||
return is_empty
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user