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

redirects: follow best practices #2

Open
derhuerst opened this issue May 3, 2020 · 1 comment
Open

redirects: follow best practices #2

derhuerst opened this issue May 3, 2020 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@derhuerst
Copy link
Owner

From the Gemini best practices:

Redirect limits

Clients may prompt their users for decisions
as to whether or not to follow a redirect, or
they may follow redirects automatically. If
you write a client which follows redirects
automatically, you should keep the following
issues in mind.

Misconfigured or malicious Gemini servers may
serve redirects in such a way that a client
which follows them blindly gets trapped in an
infinite loop of redirects, or otherwise has
to complete a very long chain of redirects.
Robust clients will need to be smart enough
to detect these conditions and act
accordingly. The simplest implementation is
to refuse to follow more than N consecutive
redirects. It is recommended that N be set
no higher than 5. This is inline with the
original recommenation for HTTP (see
RFC-2068).

Cross-protocol redirects

Cross-protocol redirects (i.e. redirects from
Gemini to something else, like Gopher) are
possible within Gemini, but are very heavily
discouraged. However, misconfigured or
malicious servers will always be able to
serve such redirects, so well-written clients
should be ready to detect them and respond
accordingly.

It is strongly recommended that even clients
which generally follow redirects
automatically alert the user and ask for
explicit confirmation when served a redirect
to a non-TLS-secured protocols like HTTP or
Gopher, assuming the client implements
support for these protocols. This avoids
unintentional plaintext transfers.

@derhuerst derhuerst added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels May 3, 2020
@derhuerst
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant