This appears to be a bug in oxide, where the user agent overrides are not used
for redirections (e.g. HTTP 302).
I can reproduce locally with the following standalone code:
== server.py ==
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import http.server as http
import threading
class HTTPRequestHandler(http.BaseHTTPRequestHandler):
def do_GET(self):
if self.path == "/foo":
self.send_response(302)
self.send_header("Location", "http://localhost:8080/bar")
self.end_headers()
self.wfile.write(b"foo")
elif self.path == "/bar":
self.send_response(200)
self.send_header("Content-Type", "text/plain")
self.end_headers()
self.wfile.write(b"bar")
else:
self.send_error(404)
if __name__ == '__main__':
server = http.HTTPServer(("", 8080), HTTPRequestHandler)
server.allow_reuse_address = True
server.serve_forever()
== client.qml ==
import QtQuick 2.4
import com.canonical.Oxide 1.9
WebView {
url: "http://localhost:8080/foo"
context: WebContext {
userAgent: "default"
userAgentOverrides: [
["^http:\/\/localhost:8080\/foo", "overridden1"],
["^http:\/\/localhost:8080\/bar", "overridden2"],
]
}
}
Then run `python3 server.py` in one terminal, monitor network traffic
with e.g. wireshark, and in another terminal run `qmlscene client.qml`.
The request to "/foo" has the first override as expected, but it
redirects to "/bar" and the corresponding request still has the first
override, instead of the second one.
** Also affects: oxide
Importance: Undecided
Status: New
** Changed in: webbrowser-app (Ubuntu)
Status: Confirmed => Invalid
** Summary changed:
- Browser stop working while watching a video on Youtube
+ UA override not used on redirect
** Changed in: oxide
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1509262
Title:
UA override not used on redirect
To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1509262/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs