Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TTCN-3 Libraries
LibIts
Commits
5e2726ae
Commit
5e2726ae
authored
Mar 31, 2022
by
YannGarcia
Browse files
CV2X#3 Validation against PKIs
parent
bf548622
Changes
1
Hide whitespace changes
Inline
Side-by-side
ttcn/Http/LibItsHttp_Functions.ttcn
View file @
5e2726ae
...
...
@@ -145,6 +145,32 @@ module LibItsHttp_Functions {
}
// End of 'for' statement
}
// End of function f_get_header
/**
* @desc Check HTTP response headers
* @param p_headers The HTTP headers
* @param p_value the expected va;ue
* @return true on success, false otherwise
*/
function
f_check_headers
(
in
Headers
p_headers
,
in
charstring
p_header_name
:=
"Location"
,
in
template
(
present
)
charstring
p_value
:=
?
)
return
boolean
{
// Local variables
var
boolean
v_header_matched
:=
false
;
for
(
var
integer
v_idx
:=
0
;
v_idx
<
lengthof
(
p_headers
);
v_idx
:=
v_idx
+
1
)
{
if
(
p_headers
[
v_idx
].
header_name
==
p_header_name
)
{
if
(
match
(
p_headers
[
v_idx
].
header_value
[
0
],
p_value
)
==
true
)
{
v_header_matched
:=
true
;
}
// else, nothing to do
break
;
}
}
// End of 'for' statement
return
v_header_matched
;
}
// End of function f_check_headers
}
// End of group http_headers
}
// End of module LibItsHttp_Functions
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment