mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-03 00:01:18 -04:00
cookie: force name to string; as for the value, only late-force it on writing the cookie
This commit is contained in:
parent
00a6e4672d
commit
37f23ad8c3
@ -107,6 +107,8 @@ module HTTPX
|
||||
|
||||
@path ||= "/"
|
||||
raise ArgumentError, "name must be specified" if @name.nil?
|
||||
|
||||
@name = @name.to_s
|
||||
end
|
||||
|
||||
def expires
|
||||
@ -122,7 +124,7 @@ module HTTPX
|
||||
# Returns a string for use in the Cookie header, i.e. `name=value`
|
||||
# or `name="value"`.
|
||||
def cookie_value
|
||||
"#{@name}=#{Scanner.quote(@value)}"
|
||||
"#{@name}=#{Scanner.quote(@value.to_s)}"
|
||||
end
|
||||
alias_method :to_s, :cookie_value
|
||||
|
||||
|
@ -31,19 +31,17 @@ module HTTPX
|
||||
|
||||
def valid_for_uri?: (uri) -> bool
|
||||
|
||||
def self.new: (Cookie) -> untyped
|
||||
| (cookie_attributes) -> untyped
|
||||
| (String, String) -> untyped
|
||||
| (String, String, cookie_attributes) -> untyped
|
||||
def self.new: (Cookie) -> instance
|
||||
| (cookie_attributes) -> instance
|
||||
| (_ToS, _ToS, ?cookie_attributes) -> instance
|
||||
|
||||
def self.path_match?: (String, String) -> bool
|
||||
|
||||
private
|
||||
|
||||
def initialize: (cookie_attributes) -> untyped
|
||||
| (String, String) -> untyped
|
||||
| (String, String, cookie_attributes?) -> untyped
|
||||
|
||||
| (_ToS, _ToS, ?cookie_attributes) -> untyped
|
||||
|
||||
def acceptable_from_uri?: (uri) -> bool
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user