Lith
Lith copied to clipboard
HEAD (or other approach) links to fetch Content-Type for video/image preview
- ... and therefore determine whether to show the Preview button or Open the preview (if "open link directly" option=true)
- Should probably be an option, also, since some people don't like giving out their IP to a server without actually opening the link.
Current state:
- Currently a primitive URL.endsWIth(".jpg") etc. is used which doesn't apply to a lot of links that are images/videos just by Content-Type and not by filename. (E.g. https://pbs.twimg.com/media/Eni5KRUXEAUg2tE?format=jpg&name=small)
This could also be used for a limit of Content-Size that is allowed to be (which could be an option) previewed in the app. (Since .e.g a 500 MB video file might not be a good idea to open in Qt? (just guessing, dunno, really))
Cons of HEAD:
- Slower
- HEAD can be disabled/unsupported on the destination server, fallback to endswith(".jpeg|.jpg") etc. then
Any other ideas?