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

[wpinet] Serve index HTML file from WebServer if available #7780

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

jwbonner
Copy link
Member

It's currently a bit awkward to use the WebServer class for a web page that is intended to be opened in a browser (such as a dashboard), because the index page is always a directory listing rather than an HTML file. The solution here is just to replace the directory listing with the contents of index.html if such a file exists (I think this is fairly standard behavior for statically serving files). Note that the behavior when adding format=json is unchanged, which allows dashboards (e.g. Elastic) to get a directory listing even if index.html exists.

@jwbonner jwbonner requested a review from a team as a code owner February 13, 2025 20:47
@github-actions github-actions bot added the component: wpinet WPI networking library label Feb 13, 2025
@PeterJohnson PeterJohnson merged commit e648b9c into wpilibsuite:main Feb 14, 2025
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: wpinet WPI networking library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants