Berry webclient.url_encode() is now a static class method, no change required to existing code (#18775)

This commit is contained in:
s-hadinger 2023-06-02 13:29:57 +02:00 committed by GitHub
parent 4e7475dbd4
commit f8df9e5f00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -33,6 +33,7 @@ All notable changes to this project will be documented in this file.
- InfluxDb resolves DNS name before request (#18015)
- Shutter sliders in WEBGUI automatically appear and disappear during configuration and update during movement (#18701)
- AdafruitFingerprint library from v2.0.4 to v2.1.0
- Berry `webclient.url_encode()` is now a static class method, no change required to existing code
### Fixed
- ESP32 InfluxDb initial connection delays using HTTPClient (#18015)

View File

@ -45,7 +45,7 @@ class be_class_webclient (scope: global, name: webclient) {
.w, var
init, func(wc_init)
deinit, func(wc_deinit)
url_encode, func(wc_urlencode)
url_encode, static_func(wc_urlencode)
begin, func(wc_begin)
set_timeouts, func(wc_set_timeouts)

View File

@ -153,12 +153,12 @@ extern "C" {
be_return_nil(vm);
}
// wc.url_encode(string) -> string
// wc.url_encode(string) -> string (static method)
int32_t wc_urlencode(struct bvm *vm);
int32_t wc_urlencode(struct bvm *vm) {
int32_t argc = be_top(vm);
if (argc >= 2 && be_isstring(vm, 2)) {
const char * s = be_tostring(vm, 2);
if (argc >= 1 && be_isstring(vm, 1)) {
const char * s = be_tostring(vm, 1);
String url = wc_UrlEncode(String(s));
be_pushstring(vm, url.c_str());
be_return(vm); /* return self */