Skip to content
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

Generate endpoint info on About page based on provided HTTP host header #822

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mhei
Copy link
Contributor

@mhei mhei commented May 12, 2022

Showing all the interface addresses we're listening on is not helpful
on the About page. However, we serve the About page, we already know
that we are reaching the server using the given hostname in the
corresponding HTTP header, so let's use it to construct the URLs.

This takes also into account that the request/access already passed
proxy server(s), uses DNS CNAMEs etc.

Warning: Since I'm not a Java developer, I marked this PR as draft. I'm also unhappy
about some code duplications I introduce here. The primary goal is to show your
my understanding on how things should work in my eyes and to start a discussing about it.

Showing all the interface addresses we're listening on is not helpful
on the About page. However, we serve the About page, we already know
that we are reaching the server using the given hostname in the
corresponding HTTP header, so let's use it to construct the URLs.

This takes also into account that the request/access already passed
proxy server(s), uses DNS CNAMEs etc.

Signed-off-by: Michael Heimpold <[email protected]>
@csamsel
Copy link
Contributor

csamsel commented May 16, 2022

It is typical that charging stations are on a different network then the users browser (charging station on a M2M/VPN connection, browser on internet), thats why we show all interfaces

@goekay
Copy link
Member

goekay commented May 17, 2022

@mhei
Copy link
Contributor Author

mhei commented May 17, 2022

I fully understand your points. However, in my setup, SteVe is listening on localhost only and proxied by an Apache server - no M2M/VPN tunnel involved. In such a setup, only the localhost interface is listed in the About page which is more confusing than useful.
Maybe an idea would be to just add the HTTP host header based addresses to the existing list?
Edit: I'll try to cast my idea into code so that we can discuss better. Please be patient 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants