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

Allow SPAs with registered http server to serve rest endpoints #881

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

James-Mart
Copy link
Member

@James-Mart James-Mart commented Oct 4, 2024

Shortcoming with the http server impl was discovered specifically when dealing with SPAs:

For example:
Chainmail is registered as an SPA, so any request that doesn't specify an extension (which would imply a request for a static asset e.g. style.css) it assumes is a client route and returns the root document. But that means that API requests like /messages/sender=alice are just returning the root document.

This PR reverses the order in which the servers are checked, checking the registered server first. Only check sites iff the registered server returns None.

@James-Mart James-Mart changed the title reverse order that the http servers are checked Allow SPAs with registered http server to server rest endpoints Oct 4, 2024
@James-Mart James-Mart changed the title Allow SPAs with registered http server to server rest endpoints Allow SPAs with registered http server to serve rest endpoints Oct 4, 2024
@James-Mart James-Mart force-pushed the check-registered-http-server-first branch from cd6fcd7 to abc800a Compare October 4, 2024 17:15
@James-Mart James-Mart marked this pull request as ready for review October 4, 2024 18:27
@James-Mart James-Mart merged commit cf617a0 into main Oct 7, 2024
4 checks passed
@James-Mart James-Mart deleted the check-registered-http-server-first branch October 7, 2024 18:21
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.

2 participants