Skip to content

A bit weird looking regex #842

@JohnLindahlTech

Description

@JohnLindahlTech

const protocol = url.match(/^http?:\/\//) ? 'http' : 'https'

The regex /^http?:\/\// will match http:// but also htt://.
Is this really intended, or should the ? be removed on this line? (It is ofcourse needed later in the https? replace regex.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAsk how to do something or how something works

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions