Skip to content

Commit

Permalink
add support for [dot] refanging
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewarren committed May 30, 2018
1 parent fc53a76 commit f70091c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.0.3] - 2018-05-30
### Fixed
- add support for [dot] refanging

## [1.0.2] - 2018-05-08
### Fixed
Expand Down
1 change: 1 addition & 0 deletions refang.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func Refang(input interface{}) (string, error) {
output = strings.Replace(output, "[.]", ".", -1)
output = strings.Replace(output, "(.)", ".", -1)
output = strings.Replace(output, "(dot)", ".", -1)
output = strings.Replace(output, "[dot]", ".", -1)

return output, nil

Expand Down
1 change: 1 addition & 0 deletions refang_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func TestRefang(t *testing.T) {
{"dots in tld 1", args{"hxxps://google[.]co[.]uk"}, "https://google.co.uk", false},
{"dots in tld 2", args{"hxxps://google.co[.]uk"}, "https://google.co.uk", false},
{"subdomain", args{"hxxps://ftp[.]example[.]com"}, "https://ftp.example.com", false},
{"dots word in brackets", args{"hxxps://google[dot]com"}, "https://google.com", false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit f70091c

Please sign in to comment.