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:
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.
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 HTTPRequestHand ler(http. BaseHTTPRequest Handler) :
self. send_response( 302)
self. send_header( "Location" , "http:// localhost: 8080/bar")
self. end_headers( )
self. wfile.write( b"foo")
self. send_response( 200)
self. send_header( "Content- Type", "text/plain")
self. end_headers( )
self. wfile.write( b"bar")
self. send_error( 404)
def do_GET(self):
if self.path == "/foo":
elif self.path == "/bar":
else:
if __name__ == '__main__': (("", 8080), HTTPRequestHandler) allow_reuse_ address = True serve_forever( )
server = http.HTTPServer
server.
server.
== client.qml ==
import QtQuick 2.4
import com.canonical.Oxide 1.9
WebView { localhost: 8080/foo"
userAgentOverr ides: [
[" ^http:\ /\/localhost: 8080\/foo" , "overridden1"],
[" ^http:\ /\/localhost: 8080\/bar" , "overridden2"],
url: "http://
context: WebContext {
userAgent: "default"
]
}
}
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.