mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
net.http: add a Header.starting_with method, to get the first header, starting with a key (#10119)
This commit is contained in:
committed by
GitHub
parent
eef445508f
commit
86778d06b1
@@ -115,6 +115,14 @@ fn test_get_custom() ? {
|
||||
}
|
||||
}
|
||||
|
||||
fn test_starting_with() ? {
|
||||
mut h := http.new_header()
|
||||
h.add_custom('Hello-1', 'world') ?
|
||||
h.add_custom('Hello-21', 'world') ?
|
||||
assert h.starting_with('Hello-') ? == 'Hello-1'
|
||||
assert h.starting_with('Hello-2') ? == 'Hello-21'
|
||||
}
|
||||
|
||||
fn test_custom_values() ? {
|
||||
mut h := http.new_header()
|
||||
h.add_custom('Hello', 'world') ?
|
||||
|
||||
Reference in New Issue
Block a user