Skip to content

Commit e63e804

Browse files
committed
feat: add CURLOPT_PROTOCOLS_STR and CURLOPT_REDIR_PROTOCOLS_STR options
1 parent f200465 commit e63e804

5 files changed

Lines changed: 70 additions & 5 deletions

File tree

lib/generated/CurlInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
// This file was generated by scripts/build-constants.js on 2022-10-31T13:17:03.761Z
7+
// This file was generated by scripts/build-constants.js on 2022-10-31T13:21:27.964Z
88
// Do not edit manually
99

1010
/**

lib/generated/CurlOption.ts

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
// This file was generated by scripts/build-constants.js on 2022-10-31T13:17:03.479Z
7+
// This file was generated by scripts/build-constants.js on 2022-10-31T13:21:27.724Z
88
// Do not edit manually
99

1010
import { CurlChunk } from '../enum/CurlChunk'
@@ -974,6 +974,13 @@ export interface CurlOption {
974974
*/
975975
readonly PROTOCOLS: 'PROTOCOLS'
976976

977+
/**
978+
* Allowed protocols.
979+
*
980+
* Official libcurl documentation: : [https://curl.haxx.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html](https://curl.haxx.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html)
981+
*/
982+
readonly PROTOCOLS_STR: 'PROTOCOLS_STR'
983+
977984
/**
978985
* Proxy to use.
979986
*
@@ -1254,6 +1261,13 @@ export interface CurlOption {
12541261
*/
12551262
readonly REDIR_PROTOCOLS: 'REDIR_PROTOCOLS'
12561263

1264+
/**
1265+
* Protocols to allow redirects to.
1266+
*
1267+
* Official libcurl documentation: : [https://curl.haxx.se/libcurl/c/CURLOPT_REDIR_PROTOCOLS_STR.html](https://curl.haxx.se/libcurl/c/CURLOPT_REDIR_PROTOCOLS_STR.html)
1268+
*/
1269+
readonly REDIR_PROTOCOLS_STR: 'REDIR_PROTOCOLS_STR'
1270+
12571271
/**
12581272
* Referer: header.
12591273
*
@@ -2765,6 +2779,13 @@ export const CurlOptionCamelCaseMap = {
27652779
*/
27662780
protocols: 'PROTOCOLS',
27672781

2782+
/**
2783+
* Allowed protocols.
2784+
*
2785+
* Official libcurl documentation: : [https://curl.haxx.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html](https://curl.haxx.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html)
2786+
*/
2787+
protocolsStr: 'PROTOCOLS_STR',
2788+
27682789
/**
27692790
* Proxy to use.
27702791
*
@@ -3045,6 +3066,13 @@ export const CurlOptionCamelCaseMap = {
30453066
*/
30463067
redirProtocols: 'REDIR_PROTOCOLS',
30473068

3069+
/**
3070+
* Protocols to allow redirects to.
3071+
*
3072+
* Official libcurl documentation: : [https://curl.haxx.se/libcurl/c/CURLOPT_REDIR_PROTOCOLS_STR.html](https://curl.haxx.se/libcurl/c/CURLOPT_REDIR_PROTOCOLS_STR.html)
3073+
*/
3074+
redirProtocolsStr: 'REDIR_PROTOCOLS_STR',
3075+
30483076
/**
30493077
* Referer: header.
30503078
*
@@ -3757,6 +3785,7 @@ export type CurlOptionName =
37573785
| 'PREREQFUNCTION'
37583786
| 'PROGRESSFUNCTION'
37593787
| 'PROTOCOLS'
3788+
| 'PROTOCOLS_STR'
37603789
| 'PROXY'
37613790
| 'PROXY_CAINFO'
37623791
| 'PROXY_CAINFO_BLOB'
@@ -3797,6 +3826,7 @@ export type CurlOptionName =
37973826
| 'READDATA'
37983827
| 'READFUNCTION'
37993828
| 'REDIR_PROTOCOLS'
3829+
| 'REDIR_PROTOCOLS_STR'
38003830
| 'REFERER'
38013831
| 'REQUEST_TARGET'
38023832
| 'RESOLVE'
@@ -5908,6 +5938,20 @@ export type CurlOptionValueType = {
59085938
*/
59095939
protocols?: CurlProtocol | null
59105940

5941+
/**
5942+
* Allowed protocols.
5943+
*
5944+
* Official libcurl documentation: : [https://curl.haxx.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html](https://curl.haxx.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html)
5945+
*/
5946+
PROTOCOLS_STR?: string | number | boolean | null
5947+
5948+
/**
5949+
* Allowed protocols.
5950+
*
5951+
* Official libcurl documentation: : [https://curl.haxx.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html](https://curl.haxx.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html)
5952+
*/
5953+
protocolsStr?: string | number | boolean | null
5954+
59115955
/**
59125956
* Proxy to use.
59135957
*
@@ -6482,6 +6526,20 @@ export type CurlOptionValueType = {
64826526
*/
64836527
redirProtocols?: CurlProtocol | null
64846528

6529+
/**
6530+
* Protocols to allow redirects to.
6531+
*
6532+
* Official libcurl documentation: : [https://curl.haxx.se/libcurl/c/CURLOPT_REDIR_PROTOCOLS_STR.html](https://curl.haxx.se/libcurl/c/CURLOPT_REDIR_PROTOCOLS_STR.html)
6533+
*/
6534+
REDIR_PROTOCOLS_STR?: string | number | boolean | null
6535+
6536+
/**
6537+
* Protocols to allow redirects to.
6538+
*
6539+
* Official libcurl documentation: : [https://curl.haxx.se/libcurl/c/CURLOPT_REDIR_PROTOCOLS_STR.html](https://curl.haxx.se/libcurl/c/CURLOPT_REDIR_PROTOCOLS_STR.html)
6540+
*/
6541+
redirProtocolsStr?: string | number | boolean | null
6542+
64856543
/**
64866544
* Referer: header.
64876545
*

lib/generated/MultiOption.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
7-
// This file was generated by scripts/build-constants.js on 2022-10-31T13:17:04.005Z
7+
// This file was generated by scripts/build-constants.js on 2022-10-31T13:21:28.213Z
88
// Do not edit manually
99

1010
/**

scripts/utils/curlOptionsBlacklist.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// This should be kept in sync with the options on src/Curl.cc curlOptionNotImplemented
22
const curlOptionsBlacklist = [
33
// to add next
4-
'CURLOPT_PROTOCOLS_STR',
5-
'CURLOPT_REDIR_PROTOCOLS_STR',
64
'CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256',
75
'CURLOPT_SSH_HOSTKEYFUNCTION',
86
// ws related options - to be added later(?)

src/Curl.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@ const std::vector<CurlConstant> curlOptionString = {
372372
{"PRE_PROXY", CURLOPT_PRE_PROXY},
373373
#endif
374374

375+
#if NODE_LIBCURL_VER_GE(7, 85, 0)
376+
{"PROTOCOLS_STR", CURLOPT_PROTOCOLS_STR},
377+
#endif
378+
375379
{"PROXY", CURLOPT_PROXY},
376380

377381
#if NODE_LIBCURL_VER_GE(7, 52, 0)
@@ -408,6 +412,11 @@ const std::vector<CurlConstant> curlOptionString = {
408412
{"QUOTE", CURLOPT_QUOTE},
409413
{"RANDOM_FILE", CURLOPT_RANDOM_FILE},
410414
{"RANGE", CURLOPT_RANGE},
415+
416+
#if NODE_LIBCURL_VER_GE(7, 85, 0)
417+
{"REDIR_PROTOCOLS_STR", CURLOPT_REDIR_PROTOCOLS_STR},
418+
#endif
419+
411420
{"REFERER", CURLOPT_REFERER},
412421

413422
#if NODE_LIBCURL_VER_GE(7, 55, 0)

0 commit comments

Comments
 (0)