Skip to content

Request validator broken with HTTPS requests containing port numbers #392

@thomasst

Description

@thomasst

According to https://www.twilio.com/docs/api/security#notes the port number should be omitted in HTTPS requests for signature validation. RequestValidator.validate should take these rules into account and not require the user to strip out the number.

My current workaround is to parse and reencode the URL as follows, but this should happen within the validate() method:

parsed = urlparse.urlparse(uri)
if parsed.scheme == 'https':
    parsed = parsed._replace(netloc=parsed.netloc.split(':')[0])
    uri = parsed.geturl()

Internal ticket: https://www.twilio.com/console/support/tickets/1061656

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