Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Inconsistent behavior for .onion and .onion. (with tailing dot) hosts #13568

Closed

Description

@cschanaj

Type: code issue

Domain: onion.

As per the following code, we do not cancel .onion requests in "Block all unencrypted requests" mode even if they are not available in HTTPS. However, the same does not hold true for .onion. (with tailing dot) requests. Requests to .onion. are forced to go through HTTPS (main_frame) or otherwise canceled if there is no applicable ruleset.

var shouldCancel = (
httpNowhereOn &&
uri.protocol === 'http:' &&
!/\.onion$/.test(uri.hostname) &&
!/^localhost$/.test(uri.hostname) &&
!/^127(\.[0-9]{1,3}){3}$/.test(uri.hostname) &&
!/^0\.0\.0\.0$/.test(uri.hostname)
);

e.g.

http://nonhttpsonionaddress.onion/ -> http://nonhttpsonionaddress.onion/

http://nonhttpsonionaddress.onion./ -> https://nonhttpsonionaddress.onion/

P.S. I am not really sure if this is the expected behavior. @Hainish @cowlicks can you confirm?

P.S.2 Possible fix in #13569

Activity

  1. https-everywhere-bot commented on Nov 12, 2017

    @https-everywhere-bot

    Thanks! Your edit helped me out. I'll take it from here now.

  2. Hainish commented on Nov 13, 2017

    @Hainish
    Member

    Indeed, this was not expected. I've merged your fix, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions