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

Add a last-ditch attempt to see if there's an md file on the end of a URL #78

Open
davep opened this issue Aug 27, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@davep
Copy link
Collaborator

davep commented Aug 27, 2023

Currently Frogmouth makes a pretty simple check to see if a file at the end of a URL is a Markdown file; quite simply by looking at the name of the file and seeing if its extension is one of the "standard" extensions. The advantage of this is that it's going to work in almost all situations where someone's wanting to view a remote markdown file, and it's not an expensive decision to make (no call out to a remote resource is needed before deciding to try).

As #77 has demonstrated though, there's some merit, albeit likely less-frequently needed, in diving a little deeper. I don't think we should dive deeper every time we're looking at a URL; but I think there's no harm in Frogmouth, once it's decided to just open the URL up in the browser, checking if there's a redirect (with a HEAD request) and having one final glance at where the request will end up.

Doing it this way will have the benefit of only making the "expensive" decision once all other routes to loading the file have failed.

@davep davep added the enhancement New feature or request label Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant