summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* file: restore old behavior for file:////foo/bar URLsJon DeVree2018-04-061-7/+13
| | | | | | | | | | | | | | | | | | | | | curl 7.57.0 and up interpret this according to Appendix E.3.2 of RFC 8089 but then returns an error saying this is unimplemented. This is actually a regression in behavior on both Windows and Unix. Before curl 7.57.0 this URL was treated as a path of "//foo/bar" and then passed to the relevant OS API. This means that the behavior of this case is actually OS dependent. The Unix path resolution rules say that the OS must handle swallowing the extra "/" and so this path is the same as "/foo/bar" The Windows path resolution rules say that this is a UNC path and automatically handles the SMB access for the program. So curl on Windows was already doing Appendix E.3.2 without any special code in curl. Regression Closes #2438
* cookie: case-insensitive hashing for the domainsLauri Kasanen2018-04-061-1/+1
| | | | closes #2458
* cookie: fix and optimize 2nd top level domain name extractionPatrick Monnerat2018-04-041-14/+14
| | | | | | | | | | | This fixes a segfault occurring when a name of the (invalid) form "domain..tld" is processed. test46 updated to cover this case. Follow-up to commit c990ead. Ref: https://github.com/curl/curl/pull/2440
* cookie: store cookies per top-level-domain-specific hash tableLauri Kasanen2018-04-021-2/+2
| | | | | | This makes libcurl handle thousands of cookies much better and speedier. Closes #2440
* test1148: set a fixed locale for the testDaniel Stenberg2018-04-021-0/+4
| | | | | | | ...as otherwise it might use a different decimal sign. Bug: #2436 Reported-by: Oumph on github
* runtests.pl: fix warning 'use of uninitialized value'Michael Kaufmann2018-03-261-1/+2
| | | | | | follow-up to a9a7b60 Closes #2428
* gitignore: ignore more generated filesDaniel Stenberg2018-03-241-1/+1
|
* parsedate: support UT timezoneNikos Tsipinakis2018-03-191-0/+1
| | | | | | | RFC822 section 5.2 mentions Universal Time, 'UT', to be synonymous with GMT. Closes #2401
* resolve: add CURLOPT_DNS_SHUFFLE_ADDRESSESRick Deist2018-03-174-1/+102
| | | | | | | | | | | This patch adds CURLOPT_DNS_SHUFFLE_ADDRESSES to explicitly request shuffling of IP addresses returned for a hostname when there is more than one. This is useful when the application knows that a round robin approach is appropriate and is willing to accept the consequences of potentially discarding some preference order returned by the system's implementation. Closes #1694
* CURLOPT_HAPROXYPROTOCOL: support the HAProxy PROXY protocolLawrence Matthews2018-03-173-1/+116
| | | | | | Add --haproxy-protocol for the command line tool Closes #2162
* cleanup: misc typos in strings and commentsluz.paz2018-03-164-5/+5
| | | | | | Found via `codespell` Closes #2389
* transfer: make HTTP without headers count correct body sizeDaniel Stenberg2018-03-154-4/+59
| | | | | | | | This is what "HTTP/0.9" basically looks like. Reported on IRC Closes #2382
* test1208: marked flakyDaniel Stenberg2018-03-151-0/+1
| | | | It fails somewhere between every 3rd to 10th travis-CI run
* tests/.../spnego.py: fix identifier typoKamil Dudka2018-03-131-1/+1
| | | | | | | | | | | | | | | Detected by Coverity Analysis: Error: IDENTIFIER_TYPO: curl-7.58.0/tests/python_dependencies/impacket/spnego.py:229: identifier_typo: Using "SuportedMech" appears to be a typo: * Identifier "SuportedMech" is only known to be referenced here, or in copies of this code. * Identifier "SupportedMech" is referenced elsewhere at least 4 times. curl-7.58.0/tests/python_dependencies/impacket/smbserver.py:2651: identifier_use: Example 1: Using identifier "SupportedMech". curl-7.58.0/tests/python_dependencies/impacket/smbserver.py:2308: identifier_use: Example 2: Using identifier "SupportedMech". curl-7.58.0/tests/python_dependencies/impacket/spnego.py:252: identifier_use: Example 3: Using identifier "SupportedMech" (2 total uses in this function). curl-7.58.0/tests/python_dependencies/impacket/spnego.py:229: remediation: Should identifier "SuportedMech" be replaced by "SupportedMech"? Closes #2379
* FTP: reject path components with control codesDaniel Stenberg2018-03-122-0/+43
| | | | | | | | | | | | | | | Refuse to operate when given path components featuring byte values lower than 32. Previously, inserting a %00 sequence early in the directory part when using the 'singlecwd' ftp method could make curl write a zero byte outside of the allocated buffer. Test case 340 verifies. CVE-2018-1000120 Reported-by: Duy Phan Thanh Bug: https://curl.haxx.se/docs/adv_2018-9cd6.html
* HTTP: allow "header;" to replace an internal header with a blank oneDaniel Stenberg2018-03-114-1/+192
| | | | | | Reported-by: Michael Kaufmann Fixes #2357 Closes #2362
* NO_PROXY: fix for IPv6 numericals in the URLDaniel Stenberg2018-03-042-1/+54
| | | | | | | | Added test 1265 that verifies. Reported-by: steelman on github Fixes #2353 Closes #2355
* build: get CFLAGS (including -werror) used for examples and testsDaniel Stenberg2018-03-044-5/+9
| | | | | | ... so that the CI and more detects compiler warnings/errors properly! Closes #2337
* unit1307: proper cleanup on OOM to fix torture testsDan Fandrich2018-03-021-8/+18
|
* unit1309: fix warning on Windows x64Marcel Raad2018-02-281-5/+9
| | | | | | | | | | When targeting x64, MinGW-w64 complains about conversions between 32-bit long and 64-bit pointers. Fix this by reusing the GNUTLS_POINTER_TO_SOCKET_CAST / GNUTLS_SOCKET_TO_POINTER_CAST logic from gtls.c, moving it to warnless.h as CURLX_POINTER_TO_INTEGER_CAST / CURLX_INTEGER_TO_POINTER_CAST. Closes https://github.com/curl/curl/pull/2341
* lib655: silence compiler warningViktor Szakats2018-02-231-1/+1
| | | | Closes https://github.com/curl/curl/pull/2335
* spelling fixesViktor Szakats2018-02-238-13/+13
| | | | | | | | Detected using the `codespell` tool. Also contains one URL protocol upgrade. Closes https://github.com/curl/curl/pull/2334
* url: Add option CURLOPT_RESOLVER_START_FUNCTIONFrancisco Sedano2018-02-215-2/+168
| | | | | | | | | | | | - Add new option CURLOPT_RESOLVER_START_FUNCTION to set a callback that will be called every time before a new resolve request is started (ie before a host is resolved) with a pointer to backend-specific resolver data. Currently this is only useful for ares. - Add new option CURLOPT_RESOLVER_START_DATA to set a user pointer to pass to the resolver start callback. Closes https://github.com/curl/curl/pull/2311
* CURLOPT_RESOLVE: Add support for multiple IP addresses per entryAnders Bakken2018-02-204-2/+234
| | | | | | | This enables users to preresolve but still take advantage of happy eyeballs and trying multiple addresses if some are not connecting. Ref: https://github.com/curl/curl/pull/2260
* test1556: verify >16KB headers to the header callbackDaniel Stenberg2018-02-164-2/+147
|
* test1154: verify that long HTTP headers get rejectedDaniel Stenberg2018-02-162-1/+58
|
* TODO fixed: Detect when called from within callbacksBjörn Stenberg2018-02-155-4/+137
| | | | Closes #2302
* tests: new tests for http raw modePatrick Monnerat2018-02-133-2/+125
| | | | | | | | | Test 319 checks proper raw mode data with non-chunked gzip transfer-encoded server data. Test 326 checks raw mode with chunked server data. Bug: #2303 Closes #2308
* smtp: fix processing of initial dot in dataPatrick Monnerat2018-02-125-4/+93
| | | | | | | | | | | RFC 5321 4.1.1.4 specifies the CRLF terminating the DATA command should be taken into account when chasing the <CRLF>.<CRLF> end marker. Thus a leading dot character in data is also subject to escaping. Tests 911 and test server are adapted to this situation. New tests 951 and 952 check proper handling of initial dot in data. Closes #2304
* fnmatch: pattern syntax can no longer failPatrick Monnerat2018-01-311-2/+3
| | | | | | | | | | | | Whenever an expected pattern syntax rule cannot be matched, the character starting the rule loses its special meaning and the parsing is resumed: - backslash at the end of pattern string matches itself. - Error in [:keyword:] results in set containing :\[dekorwy. Unit test 1307 updated for this new situation. Closes #2273
* fnmatch: accept an alphanum to be followed by a non-alphanum in char setPatrick Monnerat2018-01-311-3/+8
| | | | | | | Also be more tolerant about set pattern syntax. Update unit test 1307 accordingly. Bug: https://curl.haxx.se/mail/lib-2018-01/0114.html
* fnmatch: do not match the empty string with a character setPatrick Monnerat2018-01-311-2/+2
|
* curl_ctype: private is*() type macros and functionsDaniel Stenberg2018-01-291-2/+4
| | | | | | | | ... since the libc provided one are locale dependent in a way we don't want. Also, the "native" isalnum() (for example) works differently on different platforms which caused test 1307 failures on macos only. Closes #2269
* lib555: drop text conversion and encode data as ascii codesPatrick Monnerat2018-01-262-14/+14
| | | | | | | | | If CURL_DOES_CONVERSION is enabled, uploaded LFs are mapped to CRLFs, giving a result that is different from what is expected. This commit avoids using CURLOPT_TRANSFERTEXT and directly encodes data to upload in ascii. Bug: https://github.com/curl/curl/pull/1872
* lib517: make variable static to avoid compiler warningDaniel Stenberg2018-01-261-1/+1
| | | | ... with clang on macos
* lib544: sync ascii code data with textual dataPatrick Monnerat2018-01-261-4/+7
| | | | | | | Data mismatch caused test 545 to fail when character encoding conversion is enabled. Bug: https://github.com/curl/curl/pull/1872
* parsedate: fix date parsing for systems with 32 bit longDaniel Stenberg2018-01-252-192/+126
| | | | | | | | | | | Make curl_getdate() handle dates before 1970 as well (returning negative values). Make test 517 test dates for 64 bit time_t. This fixes bug (3) mentioned in #2238 Closes #2250
* SChannel/WinSSL: Implement public key pinningmoparisthebest2018-01-251-0/+1
| | | | Closes #1429
* test1454: --connect-to with IPv6 address w/o IPv6 support!Daniel Stenberg2018-01-232-1/+39
|
* http: prevent custom Authorization headers in redirectsDaniel Stenberg2018-01-223-1/+190
| | | | | | | | | | | | ... unless CURLOPT_UNRESTRICTED_AUTH is set to allow them. This matches how curl already handles Authorization headers created internally. Note: this changes behavior slightly, for the sake of reducing mistakes. Added test 317 and 318 to verify. Reported-by: Craig de Stigter Bug: https://curl.haxx.se/docs/adv_2018-b3bf.html
* curl: progress bar refresh, get width using ioctl()Daniel Stenberg2018-01-221-1/+2
| | | | | | | | | | | | | Get screen width from the environment variable COLUMNS first, if set. If not, use ioctl(). If nether works, assume 79. Closes #2242 The "refresh" is for the -# output when no total transfer size is known. It will now only use a single updated line even for this case: The "-=O=-" ship moves when data is transferred. The four flying "hashes" move (on a sine wave) on each refresh, independent of data.
* test558: fix for multissl buildsDaniel Stenberg2018-01-181-0/+1
| | | | | | vtls.c:multissl_init() might do a curl_free() call so strip that out to make this work with more builds. We just want to verify that memorytracking works so skipping one line is no harm.
* unit1307: test many wildcards tooDaniel Stenberg2018-01-171-1/+5
|
* ftp-wildcard: fix matching an empty string with "*[^a]"Daniel Stenberg2018-01-171-13/+12
| | | | | | | | .... and avoid advancing the pointer to trigger an out of buffer read. Detected by OSS-fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5251 Assisted-by: Max Dymond
* mime: clone mime tree upon easy handle duplication.Patrick Monnerat2018-01-144-2/+288
| | | | | | | | | | | | | | | | | | | | | A mime tree attached to an easy handle using CURLOPT_MIMEPOST is strongly bound to the handle: there is a pointer to the easy handle in each item of the mime tree and following the parent pointer list of mime items ends in a dummy part stored within the handle. Because of this binding, a mime tree cannot be shared between different easy handles, thus it needs to be cloned upon easy handle duplication. There is no way for the caller to get the duplicated mime tree handle: it is then set to be automatically destroyed upon freeing the new easy handle. New test 654 checks proper mime structure duplication/release. Add a warning note in curl_mime_data_cb() documentation about sharing user data between duplicated handles. Closes #2235
* test395: HTTP with overflow Content-Length valueDaniel Stenberg2018-01-132-1/+56
|
* test394: verify abort of rubbish in Content-Length: valueDaniel Stenberg2018-01-132-1/+60
|
* test393: verify --max-filesize with excessive Content-LengthDaniel Stenberg2018-01-132-1/+62
|
* HTTP: bail out on negative Content-Length: valuesDaniel Stenberg2018-01-131-1/+8
| | | | | | | | | | ... and make the max filesize check trigger if the value is too big. Updates test 178. Reported-by: Brad Spencer Fixes #2212 Closes #2223
* scripts: allow all perl scripts to be run directlyJay Satiro2018-01-076-1/+1
| | | | | | | | - Enable execute permission (chmod +x) - Change interpreter to /usr/bin/env perl Closes https://github.com/curl/curl/pull/2222