Skip to content

Commit

Permalink
added rewrites for feedback and project/threads, as well as fixed log…
Browse files Browse the repository at this point in the history
…in html rewrite to rewrite /assets to /proxy-url/assets
  • Loading branch information
stikkireddy committed Apr 23, 2024
1 parent ad055b8 commit 3346995
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion dbtunnel/vendor/asgiproxy/frameworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ def _modify_js_content_root_rewrite(content):
return content

def _modify_js_bundle(content, root_path):
list_of_uris = [b"/project/settings", b"/auth/config", b"/ws/socket.io", b"/logo", b"/readme", b"/login", b"/auth"]
list_of_uris = [
b"/feedback",
b"/project",
b"/auth/config",
b"/ws/socket.io",
b"/logo",
b"/readme",
b"/login",
b"/auth"]
for uri in list_of_uris:
content = content.replace(uri, root_path.encode("utf-8") + uri)

Expand Down Expand Up @@ -70,6 +78,7 @@ def _modify_settings(content, root_path):
"rewrite_host_header": f"{service_host}:{service_port}",
"modify_content": {
"/": modify_root,
"/login": modify_root,
"": modify_root,
"*assets/index-*.js": modify_js_bundle,
"*settings": modify_settings,
Expand Down Expand Up @@ -178,6 +187,7 @@ def _modify_js_bundle(content, root_path):
)()
return config


class Frameworks:
STREAMLIT: str = "streamlit"
GRADIO: str = "gradio"
Expand Down

0 comments on commit 3346995

Please sign in to comment.