-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
use mimetype to decide if typesetting is needed #38
Conversation
When the path portion of the URI contains . - for example in the query part like in `geminispace.info/search?test.com` - the page is not handled by `typesetgmi`. Instead of matching the `path` part of the URI we check the mimetype from meta instead. I'm currently unsure if the dot in a query part should be percent-encoded anyway (quick research lead to ambigous results). At least for now astro does not percent-encode it.
Hello, the MEDIA response is optional, can you add the empty case to the switch? |
oh well, i wasn't aware of this - thanks for the hint. As i understand the spec mime type is mandatory when serving anything other then text/gemini but can be omited when it is text/gemini. I gonna update the PR |
According to the spec an empty mimetype should be treated as "text/gemini".
astro
Outdated
*".gmi"|"") typesetgmi ;; | ||
*.*) cat ;; | ||
*) typesetgmi ;; | ||
case ${meta#[0-9][0-9]" "} in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, this ${#}
is specific to bash, we cannot use this, it breaks POSIX standard.
Whats is wrong with meta to need this?
I think line 380 is enough to be
*"text/gemini"* | "") typesetgmi ;;
Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm - according to https://pubs.opengroup.org/onlinepubs/9699919799/ this behaviour is defined for POSIX shells and shellcheck
does not complain about it being undefined in POSIX.
meta
contains the status code as well (e.g. 10 text/gemini
), ""
would not match.
update: i tried in dash
and it works fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind - i finally get what you where talking about 🤦
Hi @rnwgnr, I left a comment on your changes. |
This comment was marked as outdated.
This comment was marked as outdated.
please squash the commits to hide my idiocracy 🤣 |
Hahahah there is no idiocracy here. You made a great work. Thanks for your time. |
When the path portion of the URI contains a dot - for example in the query part like in
geminispace.info/search?test.com
- the page is not handled bytypesetgmi
. Instead of matching thepath
part of the URI we check the mimetype from meta instead.I'm currently unsure if the dot in a query part should be percent-encoded anyway (quick research lead to ambigous results). At least for now astro does not percent-encode it.