This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tools.hermes-voice: serve the page with a query string

/?listen, which the Android app opens, matched no static file and got 404.

+5 -2
+5 -2
tools/hermes-voice/hermes_voice.py
··· 46 46 import threading 47 47 import time 48 48 import urllib.error 49 + import urllib.parse 49 50 import urllib.request 50 51 from http import HTTPStatus 51 52 from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer ··· 618 619 # Missing until the Android signing key exists. 619 620 "/.well-known/assetlinks.json": (".well-known/assetlinks.json", "application/json"), 620 621 } 621 - if self.path not in names or not (self.static / names[self.path][0]).is_file(): 622 + # The page takes query parameters (/?listen from the Android app). 623 + path = urllib.parse.urlsplit(self.path).path 624 + if path not in names or not (self.static / names[path][0]).is_file(): 622 625 self.send_error(HTTPStatus.NOT_FOUND) 623 626 return 624 - name, content_type = names[self.path] 627 + name, content_type = names[path] 625 628 body = (self.static / name).read_bytes() 626 629 self.send_response(HTTPStatus.OK) 627 630 self.send_header("Content-Type", content_type)