126 Commits

Author SHA1 Message Date
DL6ER
dfdb047498
Expose if server ports are bound
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-11 20:25:45 +01:00
DL6ER
e92dbe12bf
Expose is_optional property of listining_ports via mg_get_server_ports()
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-12 19:43:46 +01:00
yubiuser
aa7de369a4
Add linux and macOS test using OpenSSL3.0
Signed-off-by: yubiuser <github@yubiuser.dev>
2024-09-23 21:49:40 +02:00
yubiuser
2775a1b860
Revert 19b70adc70
Signed-off-by: yubiuser <github@yubiuser.dev>
2024-08-23 12:57:42 +02:00
tim
c8bdc706b6 [#1276] limit preamble, add test case 2024-08-08 23:37:15 +01:00
tim
644d3cdeaa [#1276] remove debug method 2024-08-08 23:28:30 +01:00
tim
ee8e08cc4a [#1276] mutipart form data
- Add some tests
- Add fixes for preamble, epilogue, transport padding, boundary lines
2024-08-08 02:36:56 +01:00
tim
0b50decfa0 [#1276] add test cases for multipart form data 2024-08-06 02:25:30 +01:00
bel2125
19b70adc70 websocket client "magic" key should be random
Fixes #1220
2023-12-30 11:18:38 +01:00
bel2125
042c508a06
Merge pull request #1172 from jfriesne/jaf-demand-create-worker-threads
Option to demand-create worker threads rather than always creating all of them inside mg_start()
2023-05-14 19:57:48 +02:00
bel2125
8db42679a4 Format code after merge 2023-05-14 11:27:59 +02:00
Jeremy Friesner
4f89995634 Added demand-spawning of threads, and prespawn_threads config argument 2023-05-13 21:16:22 -07:00
Jeremy Friesner
68479acb5f fallback_document_root and fallback_websocket_root initial implementation 2023-05-05 13:08:49 -07:00
bel2125
d7ba35bbb6 Update unit test for directory listing
After #1086, the directory listing starts with a <!DOCTYPE html> tag
2023-04-08 17:38:36 +02:00
bel2125
a4a52ae9f6 Remove unit test for obsolete "file in memory" feature 2023-04-08 10:11:28 +02:00
bel2125
4af4d2e010 Remove obsolete callback from the documentation and sort according to code
Remove also the obsolete code in the unit test.

closes #1095
2023-04-08 08:27:08 +02:00
bel2125
6e0770d012 Unit test: 405 and 401 are both valid responses for rejected PUT requests
405 Method Not Allowed ... if there is no file system at the embedded server OR if no auth file
for put has been provided (PUT will never be possible)

401: send an authentication request if there is an auth file (PUT would be possible in principle)
2023-04-07 21:22:27 +02:00
bel2125
6ca12def93 Fix compiler warnings
Mostly signed/unsigned conversion warnings from GCC
2023-04-06 22:46:52 +02:00
bel2125
271882c0a6
Merge pull request #1119 from mjtrangoni/fix-codespell-issues
Fix codespell issues
2022-12-31 19:13:22 +01:00
Mario Trangoni
cd77308dc0 spelling: Fix unittest/* issues.
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2022-12-30 16:04:02 +01:00
Niklas Fiekas
78be8fe0fe Do not try PUT/DELETE auth if not configured
The authorization prompt for PUT/DELETE requests can be confusing for
people not using the feature. Do not even ask for authorization on PUT and
DELETE requests, if PUT_DELETE_PASSWORDS_FILE is not configured.
2022-10-25 13:52:47 +02:00
Zopolis4
d5f651389a
Restrict overmatching MACH ifdef to only trigger on OSX and Mach 2022-09-22 10:17:03 +10:00
bel2125
2466497c24 Add type casts for mg_base64_decode
fixes #1073 but does not change the interface
2022-05-23 18:49:57 +02:00
bel2125
14182bd4f4 Provide mg_match() as public interface
Add a new (experimental) public interface for pattern matching.
For details: see #499.
The documentation is currently in this issue and in unit test code.
An example has to be added.
2022-02-26 18:46:30 +01:00
bel2125
0874322e76 Rewrite pattern matching (#499)
Pattern matching caused several problems. For details see #499 and
issues referenced therein. There are only minor incompatibilities
as compared to the original behavior:

Now: The ? pattern will match every character, except '\0' and '/'
Before: The ? pattern will match every character except '\0'
Reasoning: It is not useful to have ? match /.
E.g. "???" would match "abc" as well as "a/c" as well as "../".

Now: The "|x" pattern will match 0 characters.
Before: The result was -1, but this was inconsistent with "x|".
The order of an empty match pattern in a match containing "|" had
influence if the empty match returned -1 or 0.

Furthermore a pattern "**" with pattern_length of 1 lead to a crash.
This has been fixed as well.
2022-02-26 10:32:19 +01:00
bel2125
c2461ca295 Add fuzz test for pattern matching 2022-02-25 19:01:33 +01:00
bel2125
185e845cd9 Pattern matching: ? should not match /
Add unit tests and examples
2022-02-23 17:58:13 +01:00
bel2125
68df179765 Fix some warnings 2021-12-11 16:02:32 +01:00
bel2125
65a80ce100 export base64 encoding/decoding to public API (#1038) 2021-11-21 15:53:08 +01:00
bel2125
b025ff0851 base64_encode/base64_decode should have a similar interface
Prepare functions so they can be exported in the public interface
See #1038
2021-11-21 13:18:39 +01:00
bel2125
5c777431dd Unit test: resolve name colission 2021-11-21 08:16:41 +01:00
bel2125
9a582f8d07 Correct CMakeFile for unittest
The "message" must be moved outside the ExternalProject definition
Fixes #1032
2021-10-26 21:06:07 +02:00
bel2125
167a871684 Print what version of the check framework is used for the unit test
The "check" unit test framework did not build for FreeBSD, due to some missing headers.
We added the headers to https://github.com/civetweb/check, but the CivetWeb unit test
on Travis CI still returns the same "missing headers" error than before.
Maybe we do not use the correct version in the unit test?
Maybe it uses the root version libcheck/check, due to some environment variable set on
Travis CI?
Remove references to libcheck/check and print the version used in the CI test.

It seems the Travis CI test i
2021-09-11 16:01:01 +02:00
bel2125
b3e90ee1e1 Move required patches for "check" unit test framework to "check"
Since we use our private copy of check anyway, move all patches there.
We need some additional patches for FreeBSD now.
Don't add another patch here, but fix it in the check framework itself.
2021-09-09 07:41:14 +02:00
bel2125
b6781c79be Remove MG_LEGACY_INTERFACE functions, release some experimental functions
Some functions have been marked as MG_LEGACY_INTERFACE since 2017.
These functions have been removed.

Some of the functions labeled as MG_EXPERIMENTAL_INTERFACES are well tested now.
They have been released (i.e., the "experimental" label was removed).
2021-08-29 23:11:43 +02:00
bel2125
184d17732e Unit test: Multiple scripts to execute unit tests locally 2021-08-29 21:46:25 +02:00
bel2125
1b0896e1e1 Update unit test script for local use on Debian Linux 2021-08-29 19:24:51 +02:00
bel2125
9660ca555d Unit test: Error message if "localhost" cannot be resolved
This seems to be a special case of container test environments.
2021-08-29 09:41:44 +02:00
bel2125
cb479ff645 Add setting to decode query strings
See discussion in #1018
2021-08-21 10:48:39 +02:00
bel2125
becfe33fac Fix server for external test
For the client unit test, we need to contact some "non-civetweb" web server.
Since we cannot host one in all test container environments, use an external web server,
e.g., the server hosting the project.
We will only make two "GET" requests to these servers, so the traffic is negligible.
2021-01-31 15:44:52 +01:00
bel2125
112fe40496 Fix some warnings 2020-11-15 15:58:35 +01:00
bel2125
e63ed80faf Fix copy/paste in unit test 2020-10-29 16:57:22 +01:00
bel2125
3019ad17c7 Add documentation for recently added features
Update UsarManual and API reference
Add unit test for parse_http_headers
2020-10-29 12:22:39 +01:00
bel2125
78aac66ed3 Add new feature defines 2020-10-27 16:25:03 +01:00
bel2125
1f1dedb200 Fix memory leak 2020-09-30 19:04:32 +02:00
bel2125
ba06e8a1ae Try to fix TravisCI issues
The same build works localy but fails on Travis. Try to change something Travis related, and see what happens.
2020-09-29 21:05:16 +02:00
bel2125
4f30388e75 Fix warnings/issues from CI/CT 2020-09-29 13:55:06 +02:00
bel2125
8d796925d4 Allow timers to add a callback to cleanup resources 2020-08-24 12:04:59 +02:00
bel2125
2640185568 Allow digits in option name 2020-08-15 10:42:52 +02:00
bel2125
5c98af1a0a Unit test: OpenSSL version dependency when using client certificates 2020-08-01 09:35:42 +02:00