summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* hsts: enable by defaultDaniel Stenberg2021-04-192-1/+2
| | | | | | No longer considered experimental. Closes #6700
* test972: verify the json output with jsonlintbagder/test-jsonDaniel Stenberg2021-04-173-1/+67
| | | | | | | Make sure one of the azure jobs has jsonlint installed so that the test runs there. Ref: #6905
* tool_writeout: fix the HTTP_CODE json outputJay Satiro2021-04-171-1/+1
| | | | | | | | Update test 970 accordingly. Reported-by: Michal Rus Fixes #6905 Closes #6906
* tool_getparam: replace (in-place) '%20' by '+' according to RFC1866Victor Vieux2021-04-151-2/+2
| | | | | | Signed-off-by: Victor Vieux <victorvieux@gmail.com> Closes #6895
* configure: provide --with-openssl, deprecate --with-sslDaniel Stenberg2021-04-151-2/+2
| | | | | | Makes the option more explicit. Closes #6887
* cookie: CURLOPT_COOKIEFILE set to NULL switches off cookiesDaniel Stenberg2021-04-144-2/+157
| | | | | | | | | Add test 676 to verify that setting CURLOPT_COOKIEFILE to NULL again clears the cookiejar from memory. Reported-by: Stefan Karpinski Fixes #6889 Closes #6891
* ntlm: fix negotiated flags usagePatrick Monnerat2021-04-0930-38/+38
| | | | | | | | | | | | | | | | | According to Microsoft document MS-NLMP, current flags usage is not accurate: flag NTLMFLAG_NEGOTIATE_NTLM2_KEY controls the use of extended security in an NTLM authentication message and NTLM version 2 cannot be negotiated within the protocol. The solution implemented here is: if the extended security flag is set, prefer using NTLM version 2 (as a server featuring extended security should also support version 2). If version 2 has been disabled at compile time, use extended security. Tests involving NTLM are adjusted to this new behavior. Fixes #6813 Closes #6849
* configure: remove use of RETSIGTYPEMichael Forney2021-04-071-3/+3
| | | | | | | | | | | This was previously defined by the obsolete AC_TYPE_SIGNAL macro, which was removed in 2682e5f5. The deprecation text says > Your code may safely assume C89 semantics that RETSIGTYPE is void. So, remove it and just use void instead. Closes #6861
* http_proxy: only loop on 407 + close if we have credentialsDaniel Stenberg2021-04-052-0/+60
| | | | | | | | | | ... to fix the retry-loop. Add test 718 to verify. Reported-by: Daniel Kurečka Fixes #6828 Closes #6850
* file: support GETing directories againLuke Granger-Brown2021-04-052-1/+36
| | | | | | | | | | | | | | After 957bc1881e686f9714c4e6a01bf33535091f0e21, we no longer compute an expected_size for directories. This has the upshot that when we compare even an empty Range with the available size, we fail. This brings back the previous behaviour, which was to succeed, but with empty content. This also removes the "Accept-ranges: bytes" header, which is nonsensical on directories. Adds test 3016 Fixes #6845 Closes #6846
* define: remove CURL_DISABLE_NTLM ifdefsbagder/disable-scan-improvementDaniel Stenberg2021-03-291-2/+2
| | | | | | | It was never defined anywhere. Fixed disable-scan (test 1165) to also scan headers, which found this issue. Closes #6809
* transfer: strip credentials from the auto-referer header fieldViktor Szakats2021-03-282-1/+67
| | | | | | | | Added test 2081 to verify. CVE-2021-22876 Bug: https://curl.se/docs/CVE-2021-22876.html
* copyright: update copyright year ranges to 2021Daniel Stenberg2021-03-2712-12/+12
| | | | | Reviewed-by: Emil Engler Closes #6802
* tests/README.md: mentioned that en_US.UTF-8 is requiredDaniel Stenberg2021-03-261-0/+1
| | | | | Reported-by: Oumph on github Fixes #6768
* http: strip default port from URL sent to proxyDaniel Stenberg2021-03-231-1/+1
| | | | | | | | | | To make sure the Host: header and the URL provide the same authority portion when sent to the proxy, strip the default port number from the URL if one was provided. Reported-by: Michael Brown Fixes #6769 Closes #6778
* ftpserver: only load the preprocessed test fileDaniel Stenberg2021-03-191-12/+6
| | | | | | We always preprocess and tests are no longer sensible to load "raw" Closes #6738
* tests: use %TESTNUMBER instead of fixed numberDaniel Stenberg2021-03-191292-4389/+4386
| | | | | | | This makes the tests easier to copy and relocate to other test numbers without having to update content. Closes #6738
* http: make 416 not fail with resume + CURLOPT_FAILONERRRORDaniel Stenberg2021-03-174-21/+102
| | | | | | | | | | | | | When asked to resume a download, libcurl will convert that to HTTP logic and if then the entire file is already transferred it will result in a 416 response from the HTTP server. With CURLOPT_FAILONERRROR set in that scenario, it should *not* lead to an error return. Updated test 1156, added test 1273 Reported-by: Jonathan Watt Fixes #6740 Closes #6753
* gen.pl: quote "bare" minuses in the nroff curl.1Daniel Stenberg2021-03-141-5/+13
| | | | | | Reported-by: Alejandro Colomar Fixes #6698 Closes #6722
* test220/314: adjust to run with HyperDaniel Stenberg2021-03-112-0/+16
|
* test306: make it not run with HyperDaniel Stenberg2021-03-111-0/+1
| | | | ... as it tests HTTP/0.9 which Hyper doesn't support.
* test304: header CRLF cleanup to work with HyperDaniel Stenberg2021-03-111-1/+1
|
* FTP: allow SIZE to fail when doing (resumed) uploadDaniel Stenberg2021-03-112-1/+52
| | | | | | | | | Added test 362 to verify. Reported-by: Jordan Brown Regression since 7ea2e1d0c5a7f (7.73.0) Fixes #6715 Closes #6725
* configure: provide Largefile feature for curl-configDaniel Stenberg2021-03-111-2/+2
| | | | | | ... as cmake now does it correctly, and make test1014 check for it Closes #6702
* lib1536: check ptr against NULL before dereferencing itkokke2021-03-101-1/+1
| | | | Closes #6710
* lib1537: check ptr against NULL before dereferencing itkokke2021-03-101-1/+1
| | | | | Fixes #6707 Closes #6708
* runtests.pl: kill processes locking test log filesMarc Hoersken2021-03-012-7/+55
| | | | | | | | | | | | | | Introduce a new runtests.pl command option: -rm For now only required and implemented for Windows. Ignore stunnel logs due to long running processes. Requires Sysinternals handle[64].exe to be on PATH. Reviewed-by: Jay Satiro Ref: #6058 Closes #6179
* pathhelp.pm: fix use of pwd -L in Msys environmentMarc Hoersken2021-03-011-3/+25
| | | | | | | | | While Msys2 has a pwd binary which supports -L, Msys1 only has a shell built-in with that feature. Reviewed-by: Jay Satiro Part of #6179
* tool_help: Increase space between option and descriptionJay Satiro2021-02-283-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Increase the minimum number of spaces between the option and the description from 1 to 2. Before: ~~~ -u, --user <user:password> Server user and password -A, --user-agent <name> Send User-Agent <name> to server -v, --verbose Make the operation more talkative -V, --version Show version number and quit -w, --write-out <format> Use output FORMAT after completion --xattr Store metadata in extended file attributes ~~~ After: ~~~ -u, --user <user:password> Server user and password -A, --user-agent <name> Send User-Agent <name> to server -v, --verbose Make the operation more talkative -V, --version Show version number and quit -w, --write-out <format> Use output FORMAT after completion --xattr Store metadata in extended file attributes ~~~ Closes https://github.com/curl/curl/pull/6674
* cookies: Support multiple -b parametersDaniel Gustafsson2021-02-252-4/+8
| | | | | | | | | | Previously only a single -b cookie parameter was supported with the last one winning. This adds support for supplying multiple -b params to have them serialized semicolon separated. Both cookiefiles and cookies can be entered multiple times. Closes #6649 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* test1188: Check for --fail HTTP statusJay Satiro2021-02-201-6/+15
| | | | | | | | | | | | | | | - Change the test to check for curl error on HTTP 404 Not Found. test1188 tests "--write-out with %{onerror} and %{urlnum} to stderr". Prior to this change it did that by specifying a non-existent host which would cause an error. ISPs may hijack DNS and resolve non-existent hosts so the test would not work if that was the case. Ref: https://en.wikipedia.org/wiki/DNS_hijacking#Manipulation_by_ISPs Ref: https://github.com/curl/curl/issues/6621 Ref: https://github.com/curl/curl/pull/6623 Closes https://github.com/curl/curl/pull/6637
* http: add support to read and store the referrer headerViktor Szakats2021-02-192-2/+5
| | | | | | | | | - add CURLINFO_REFERER libcurl option - add --write-out '%{referer}' command-line option - extend --xattr command-line option to fill user.xdg.referrer.url extended attribute with the referrer (if there was any) Closes #6591
* test1188: change error from connect to resolve errorDaniel Stenberg2021-02-181-2/+2
| | | | | | | | | | | | Using the %NOLISTENPORT to trigger a connection failure is somewhat "risky" (since it isn't guaranteed to not be listened to) and caused occasional CI problems. This fix changes the infused error to be a more reliable one but still verifies the --write-out functionality properly - which is the purpose of this test. Reported-by: Jay Satiro Fixes #6621 Closes #6623
* http: use credentials from transfer, not connectionDaniel Stenberg2021-02-133-4/+61
| | | | | | | | | | | | | | | | | | | HTTP auth "accidentally" worked before this cleanup since the code would always overwrite the connection credentials with the credentials from the most recent transfer and since HTTP auth is typically done first thing, this has not been an issue. It was still wrong and subject to possible race conditions or future breakage if the sequence of functions would change. The data.set.str[] strings MUST remain unmodified exactly as set by the user, and the credentials to use internally are instead set/updated in state.aptr.* Added test 675 to verify different credentials used in two requests done over a reused HTTP connection, which previously behaved wrongly. Fixes #6542 Closes #6545
* test433: clear some home dir env variablesDaniel Stenberg2021-02-121-0/+2
| | | | | | | | | | Follow-up to bd6b54ba1f55b5 ... so that XDG_CONFIG_HOME is the only home dir variable set and thus used correctly in the test! Fixes #6599 Closes #6600
* urldata: don't touch data->set.httpversion at run-timeDaniel Stenberg2021-02-122-1/+58
| | | | | | | | | Rename it to 'httpwant' and make a cloned field in the state struct as well for run-time updates. Also: refuse non-supported HTTP versions. Verified with test 129. Closes #6585
* tests: disable .curlrc in more environmentsViktor Szakats2021-02-111-0/+2
| | | | | | | | | by also setting CURL_HOME and XDG_CONFIG_HOME envvars to the local directory. Reviewed-by: Daniel Stenberg Fixes #6595 Closes #6596
* curl: add --fail-with-bodyDaniel Stenberg2021-02-115-3/+128
| | | | | | | | Prevent both --fail and --fail-with-body on the same command line. Verify with test 349, 360 and 361. Closes #6449
* tests: Fix tests failing due to change in curl --helpJay Satiro2021-02-102-2/+2
| | | | | | | Follow-up to parent 3183217 which added add missing <mode> argument to --create-file-mode <mode>. Ref: https://github.com/curl/curl/issues/6590
* server: remove redundant conditionMarcel Raad2021-02-102-2/+0
| | | | | | `end` is always non-null here. Closes https://github.com/curl/curl/pull/6576
* mqttd: remove unused variableMarcel Raad2021-02-101-2/+0
| | | | Closes https://github.com/curl/curl/pull/6576
* tests: reduce variable scopesMarcel Raad2021-02-102-7/+4
| | | | Closes https://github.com/curl/curl/pull/6576
* ftp: add 'list_only' to the transfer state structDaniel Stenberg2021-02-092-1/+74
| | | | | | | | | and rename it from 'ftp_list_only' since it is also used for SSH and POP3. The state is updated internally for 'type=D' FTP URLs. Added test case 1570 to verify. Closes #6578
* ftp: add 'prefer_ascii' to the transfer state structDaniel Stenberg2021-02-094-2/+124
| | | | | | | | | | | ... and make sure the code never updates 'set.prefer_ascii' as it breaks handle reuse which should use the setting as the user specified it. Added test 1569 to verify: it first makes an FTP transfer with ';type=A' and then another without type on the same handle and the second should then use binary. Previously, curl failed this. Closes #6578
* lib: use int type for more port variablesJay Satiro2021-02-092-2/+2
| | | | | | | This is a follow-up to 764c6bd. Prior to that change port variables were usually type long. Closes https://github.com/curl/curl/pull/6553
* tool_writeout: refactor write-out and write-out jsonJay Satiro2021-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | - Deduplicate the logic used by write-out and write-out json. Rather than have separate writeLong, writeString, etc, logic for each of write-out and write-out json instead have respective shared functions that can output either format and a 'use_json' parameter to indicate whether it is json that is output. This will make it easier to maintain. Rather than have to go through two sets of logic now we only have to go through one. - Support write-out %{errormsg} and %{exitcode} in json. - Clarify in the doc that %{exitcode} is the exit code of the transfer. Prior to this change it just said "The numerical exitcode" which implies it's the exit code of the tool, and it's not necessarily that. Closes https://github.com/curl/curl/pull/6544
* file: Support unicode urls on windowsStephan Szabo2021-02-094-1/+52
| | | | Closes https://github.com/curl/curl/pull/6501
* tests/server: Bump MAX_TAG_LEN to 200Fabian Keil2021-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful for tests containing HTML inside of <data> sections. For <img> tags it's not uncommon to be longer than the previous limit of 79 bytes. An example of a previously problem-causing tag is: <img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="88" height="31"> which is needed for a Privoxy test for the banners-by-size filter. Previously it caused server failures like: 12:29:05.786961 ====> Client connect 12:29:05.787116 accept_connection 3 returned 4 12:29:05.787194 accept_connection 3 returned 0 12:29:05.787285 Read 119 bytes 12:29:05.787345 Process 119 bytes request 12:29:05.787407 Got request: GET /banners-by-size/9 HTTP/1.1 12:29:05.787464 Requested test number 9 part 0 12:29:05.787686 getpart() failed with error: -2 12:29:05.787744 - request found to be complete (9) 12:29:05.787912 getpart() failed with error: -2 12:29:05.788048 Wrote request (119 bytes) input to log/server.input 12:29:05.788157 Send response test9 section <data> 12:29:05.788443 getpart() failed with error: -2 12:29:05.788498 instructed to close connection after server-reply 12:29:05.788550 ====> Client disconnect 0 12:29:05.871448 exit_signal_handler: 15 12:29:05.871714 signalled to die 12:29:05.872040 ========> IPv4 sws (port 21108 pid: 51758) exits with signal (15)
* tests/badsymbols.pl: when opening '$incdir' fails include it in the error ↵Fabian Keil2021-02-091-1/+1
| | | | message
* runtests.1: document -o, -P, -L, and -EFabian Keil2021-02-091-1/+22
|