-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration API returns unexpected values for by_host option #16454
Comments
Sorry I forgot I assigned myself to this one 🤦♂️ I'm just checking 23.0 branch and I couldn't find |
It is themes_config_file the by host extension is a feature that is enabled if you want by host configurations. |
Ouch, I didn't know that... I guess those dynamic config options will need to be taken into account in the future Pydantic model #16518 |
In the response model you shouldn't know about |
I think I might have found the reason why it is not discriminating the When getting the config through the UI controller we are using WSGI and But when using the API endpoint we are going through the ASGI request which internally translates That is why we always get the |
It is confirmed to be broken with proper subdomains as well. |
Interesting... Hmmm, the logic itself looks fine, it would be useful to see what is in the |
The solution is probably somewhere in the ASGI to WSGI middleware, if it works on old-style request objects. |
yep, it's in the host header, the logic in the webob.Request class is this ( def _host__get(self):
"""Host name provided in HTTP_HOST, with fall-back to SERVER_NAME"""
if 'HTTP_HOST' in self.environ:
return self.environ['HTTP_HOST']
else:
return '%(SERVER_NAME)s:%(SERVER_PORT)s' % self.environ and the logic in the middleware is this: # Go through headers and make them into environ entries
for name, value in scope.get("headers", []):
name = name.decode("latin1")
if name == "content-length":
corrected_name = "CONTENT_LENGTH"
elif name == "content-type":
corrected_name = "CONTENT_TYPE"
else:
corrected_name = f"HTTP_{name}".upper().replace("-", "_") we could do the same, or we could use |
Definitely a big bug... 😓 |
Should be fixed by #16574 |
Describe the bug
/api/configuration
does not return the correct themes, if the themes are set per host.This behavior leads to the themes not being selectable for users on subdomain configurations.
Galaxy Version and/or server at which you observed the bug
Galaxy Version: 23.0 - dev
To Reproduce
Steps to reproduce the behavior:
themes_config_file_by_host
in the galaxy configuration to two different hosts.localhost
and127.0.0.1
can be used for local testing/api/configuration
for each of these URLs, and observe that the themes do not match the set, or displayed themesExpected behavior
/api/configuration
reflects the correct configuration per hostAdditional Context
The configuration inlined in the client html behaves as expected (see #16455), which is why the default theme is applied correctly.
The text was updated successfully, but these errors were encountered: