MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / parseUrlEncoded

Function parseUrlEncoded

src/webInterface.cpp:147–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void parseUrlEncoded(const String &body, WebParamMap &params) {
148 int start = 0;
149 while (start <= body.length()) {
150 int amp = body.indexOf('&', start);
151 if (amp < 0) amp = body.length();
152 String pair = body.substring(start, amp);
153 int eq = pair.indexOf('=');
154 if (eq >= 0) params.values[urlDecode(pair.substring(0, eq))] = urlDecode(pair.substring(eq + 1));
155 if (amp == body.length()) break;
156 start = amp + 1;
157 }
158}
159
160String headerValue(httpd_req_t *req, const char *name) {
161 size_t len = httpd_req_get_hdr_value_len(req, name);

Callers 1

readParamsFunction · 0.85

Calls 1

urlDecodeFunction · 0.85

Tested by

no test coverage detected