Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(uri_normalizer): update the functionality of api
- Loading branch information
1 parent
c862d3e
commit 1eae155
Showing
8 changed files
with
54 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
module HTTP | ||
module Features | ||
class NormalizeUri < Feature | ||
attr_reader :normalizer | ||
|
||
def initialize(normalizer: Normalizer) | ||
@normalizer = normalizer | ||
end | ||
|
||
def normalize_uri(uri) | ||
normalizer.call(uri) | ||
end | ||
|
||
module Normalizer | ||
def self.call(uri) | ||
HTTP::URI::NORMALIZER.call(uri) | ||
end | ||
end | ||
|
||
HTTP::Options.register_feature(:normalize_uri, self) | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters