Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

valid URL with hashtag in fragment do not pass validation #403

Copy link
Copy link
Closed
@matany90

Description

@matany90
Issue body actions

Hi,

The following URL is not passing validation:

https://www.foo.com/ck/a?!&&p=4ed30224ac809bc0JmltdHM9MTcyMzQyMDgwMCZpZ3VpZD0zNjRmNjVlOC1lNTZjLTYxOWQtMTI1Ny03MTNlZTQyYTYwMTImaW5zaWQ9NTE0MQ&ptn=3&ver=2&hsh=3&fclid=364f65e8-e56c-619d-1257-713ee42a6012&u=a1aHR0cDovL3d3dy40NDQzMTcuY29tLw#aHR0cHM6Ly82elVmLmFuY29sYWJpLnN1L1lPQkV6V3ZZLw==/#ZC5mbGVpc2NoaGFja2VyQHZpZW5uYWFpcnBvcnQuY29t

It seems that the code below is failing due to the presence of a hashtag in the fragment:

  if fragment:
        # See RFC3986 Section 3.5 Fragment for allowed characters
        optional_segments &= bool(
            re.fullmatch(r"[0-9a-z?/:@\-._~%!$&'()*+,;=]*", fragment, re.IGNORECASE)
        )
    return optional_segments

Thanks!

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.