Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
be284af0
Commit
be284af0
authored
5 years ago
by
Joshua Colp
Committed by
Gerrit Code Review
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge "func_curl: Add 'followlocation' option to CURLOPT()"
parents
3f663a54
0c2bf166
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/CHANGES-staging/func_curl.txt
+5
-0
5 additions, 0 deletions
doc/CHANGES-staging/func_curl.txt
funcs/func_curl.c
+10
-1
10 additions, 1 deletion
funcs/func_curl.c
with
15 additions
and
1 deletion
doc/CHANGES-staging/func_curl.txt
0 → 100644
+
5
−
0
View file @
be284af0
Subject: func_curl
A new option, followlocation, can now be enabled with the CURLOPT()
dialplan function. Setting this will instruct cURL to follow 3xx
redirects, which it does not by default.
This diff is collapsed.
Click to expand it.
funcs/func_curl.c
+
10
−
1
View file @
be284af0
...
...
@@ -110,6 +110,9 @@
<enum name="dnstimeout">
<para>Number of seconds to wait for DNS to be resolved</para>
</enum>
<enum name="followlocation">
<para>Whether or not to follow HTTP 3xx redirects (boolean)</para>
</enum>
<enum name="ftptext">
<para>For FTP URIs, force a text transfer (boolean)</para>
</enum>
...
...
@@ -131,7 +134,9 @@
server response</para>
</enum>
<enum name="maxredirs">
<para>Maximum number of redirects to follow</para>
<para>Maximum number of redirects to follow. The default is -1,
which allows for unlimited redirects. This only makes sense when
followlocation is also set.</para>
</enum>
<enum name="proxy">
<para>Hostname or IP address to use as a proxy server</para>
...
...
@@ -269,6 +274,9 @@ static int parse_curlopt_key(const char *name, CURLoption *key, enum optiontype
}
else
if
(
!
strcasecmp
(
name
,
"proxyuserpwd"
))
{
*
key
=
CURLOPT_PROXYUSERPWD
;
*
ot
=
OT_STRING
;
}
else
if
(
!
strcasecmp
(
name
,
"followlocation"
))
{
*
key
=
CURLOPT_FOLLOWLOCATION
;
*
ot
=
OT_BOOLEAN
;
}
else
if
(
!
strcasecmp
(
name
,
"maxredirs"
))
{
*
key
=
CURLOPT_MAXREDIRS
;
*
ot
=
OT_INTEGER
;
...
...
@@ -858,6 +866,7 @@ static struct ast_custom_function acf_curlopt = {
" cookie - Send cookie with request [none]
\n
"
" conntimeout - Number of seconds to wait for connection
\n
"
" dnstimeout - Number of seconds to wait for DNS response
\n
"
" followlocation - Follow HTTP 3xx redirects (boolean)
\n
"
" ftptext - For FTP, force a text transfer (boolean)
\n
"
" ftptimeout - For FTP, the server response timeout
\n
"
" header - Retrieve header information (boolean)
\n
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment