Commit Graph

14 Commits

Author SHA1 Message Date
Martin Natano 78fb2e9fc3 Decouple <cstddef> 2023-04-20 11:21:29 +02:00
Michael Sundqvist 0cba3579de Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements
Fix whitespace changes
2022-07-31 22:14:38 +02:00
Martin Natano 258fd61229 Use mbedtls on all platforms & bundle root CAs
Certificate bundle downloaded from https://curl.se/docs/caextract.html.
It is licensed under the MPL 2.0.
2022-06-07 10:54:10 +02:00
Martin Natano d8586b02b2 Add NETWORK:WebSocket() 2022-05-27 23:42:37 +02:00
Martin Natano b039be360c Fix subdomain matching 2022-05-01 17:33:52 +02:00
Martin Natano f7d8408fc2 Add support for subdomain wildcards to HttpAllowHosts 2022-05-01 13:16:14 +02:00
Martin Natano 6cd4ac88c3 Fix error reporting when opening the download file fails 2022-05-01 10:42:28 +02:00
Martin Natano 692310a0e4 Tweak defaults for the HTTP preferences
Connections to GrooveStats are now allowed by default.
2022-04-13 21:56:04 +02:00
Martin Natano ca86f80743 Add support for onProgress and downloadFile to NETWORK:HttpRequest() 2022-03-13 11:31:49 -07:00
Martin Natano d8b6d36a78 Allow to mark preferences as immutable or deprecated
- Deprecated: The option is read from the settings, but not written back
  when saving. This can be used for migrating options to a new name or
  format. (Not used yet.)
- Immutable: The option can not be changed from Lua. Used for
  security-relevant options that should not be changable by the theme or
  mod charts. Currently that's networking and some file system access
  options.
2022-03-12 22:19:19 +01:00
Martin Natano 3fab481611 fixup collect 2022-01-15 22:56:22 +01:00
Martin Natano bb826dc0b2 Allow cancellation of HTTP requests
`NETWORK::HttpRequest()` now returns a HttpRequestFuture with a
`Cancel()` method.
2022-01-15 22:56:22 +01:00
Martin Natano bc4a275510 Add parameter encoding helpers to NETWORK
This adds two more methods:
- `NETWORK:UrlEncode()`: Encode a single string value.
- `NETWORK:EncodeQueryParameters()`: Encode a table as query string.
2022-01-15 22:56:08 +01:00
Martin Natano dc49af3c59 Implement NetworkManager
For now there are two methods:

- `NETWORK:IsUrlAllowed()`: Check whether access to a certain URL is allowed.
- `NETWORK:HttpRequest()`: Perform an HTTP request.

By default access to the network is disabled for all target hosts. It
can be enabled by setting `HttpEnable=1` in the preferences. Individual
hosts have to be added to `HttpAllowHosts` as a comma separated list to
allow access.

See included docs for more details on usage.
2022-01-15 22:56:08 +01:00