Skip to content

Commit

Permalink
refang links with 'httpx'
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewarren committed Jun 1, 2021
1 parent 775f56b commit 40694f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions refang.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ func Refang(input interface{}) (string, error) {
output = strings.Replace(output, "[//]", "//", -1)
output = strings.Replace(output, "<//>", "//", -1)

output = strings.Replace(output, "httpx", "https", -1)

return output, nil
}
1 change: 1 addition & 0 deletions refang_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func TestRefang(t *testing.T) {
wantErr bool
}{
{"simple http", args{"hxxp://google[.]com"}, "http://google.com", false},
{"simple httpx", args{"httpx://google[.]com"}, "https://google.com", false},
{"simple http 2", args{"hXXp://evil.example[.]com/malicious.php"}, "http://evil.example.com/malicious.php", false},
{"simple https", args{"hxxps://google[.]com"}, "https://google.com", false},
{"meow", args{"meows://google[.]com"}, "https://google.com", false},
Expand Down

0 comments on commit 40694f7

Please sign in to comment.