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

Explicit shortcut API #654

Closed
thvitt opened this issue May 13, 2021 · 0 comments
Closed

Explicit shortcut API #654

thvitt opened this issue May 13, 2021 · 0 comments
Assignees
Labels

Comments

@thvitt
Copy link
Member

thvitt commented May 13, 2021

Shortcuts (i.e. vers numbers or sigils) are currently implemented in the controller by generating redirects to the target URL, optionally including the URL fragment.

This works fine when the main browser window navigates to /query?q=〈shortcut〉, however, the AJAX solution for the search page implemented in faustedition/faust-web#583 appearently has no way to access the actual target URL including the fragment:

(a) using fetch(…, {redirect: 'auto'}) follows all redirects but the response does no longer include the fragment
(b) using fetch(…, {redirect: 'manual'}) (or error) is practically indistinguishable from a network error, header data is available.

A separate function that could be used from the controller could either generate the new URL in a simple non-redirect response or generate an error on a 'no shortcut' case especially for the AJAX search API while the /query endpoint could continue working in the same way as it does now.

@thvitt thvitt self-assigned this May 13, 2021
thvitt added a commit to faustedition/faust-web that referenced this issue May 13, 2021
This works around the problem with the solution for #583 that we cannot
access the URL fragment returned by the redirect using JS API.

It can be replaced by a call to the shortcut API outlined in
faustedition/faust-gen-html#654 once that is
in place.
@thvitt thvitt closed this as completed in 7739eca May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant