Skip to content

Commit

Permalink
Merge pull request #133 from hahwul/hahwul-dev
Browse files Browse the repository at this point in the history
Fixed #132
  • Loading branch information
hahwul authored Oct 6, 2023
2 parents cc13b8b + 186241d commit 15c4869
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions spec/unit_test/models/deliver_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ describe "Initialize" do
object = Deliver.new options
object.proxy.should eq("http://localhost:8090")
end

it "Deliver with headers" do
options[:send_with_headers] = "X-API-Key: abcdssss"
object = Deliver.new options
object.headers["X-API-Key"].should eq("abcdssss")
end
end
6 changes: 5 additions & 1 deletion src/models/deliver.cr
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Deliver
if header.includes? ":"
@logger.debug "Adding '#{header}' to headers."
splited = header.split(":")
@headers[splited[0]] = splited[1].gsub("s", "")
@headers[splited[0]] = splited[1].gsub(/\s/, "")
end
end
@logger.info_sub "#{@headers.size} headers added."
Expand All @@ -35,6 +35,10 @@ class Deliver
@proxy
end

def headers
@headers
end

def run
# After inheriting the class, write an action code here.
end
Expand Down

0 comments on commit 15c4869

Please sign in to comment.