Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Decoding Error. two times called urlDecode in Parsing-impl.h. #17

Closed
RQnet opened this issue Mar 1, 2022 · 3 comments
Closed

Decoding Error. two times called urlDecode in Parsing-impl.h. #17

RQnet opened this issue Mar 1, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@RQnet
Copy link

RQnet commented Mar 1, 2022

Describe the bug

if i use password with special charakters like "%&*%25%26" with WiFiManager_NINA_lite V1.6.1 the decoding of this password is wrong. I got just "%". I use "GET" with urlDecoded value request.

Steps to Reproduce

just send this password %&*%25%26 with WiFiManager_NINA_lite

Problem

urlDecode(.....) is called two times.
first in _parseRequest() -> urlDecode(...)
second in _parseRequest() -> _parseArguments(...) -> (void)_parseArgumentsPrivate(data, storeArgHandler()); -> urlDecode(...)

the first call is decoding and the second decoding is trimming at the "&".

Solution

replace this line
searchStr = urlDecode(url.substring(hasSearch + 1));

with that line
searchStr = url.substring(hasSearch + 1);

problem

solution

@khoih-prog
Copy link
Owner

Hi @RQnet

Thanks for your bug report and very detailed investigative information. I wish any bug report will be as good as this one from you.

I definitely will fix this hard-to-find bug, with a note for your contribution. If you have some more time, please help by doing some more tests to see if there are anymore bug relating to this duplicated use of urlDecode().

Regards,


PS:

You can also create a PR. If you're not familiar now, it's good time to start and be a PR master.
Some unimportant note: it's better to post the code and terminal output in code tag, not picture.

I'm glad to see you've been moving forward quite fast from recent posts. Successfully debugging, which requires you read and understand the library code, will definitely help you a lot in the future.

khoih-prog added a commit that referenced this issue Mar 2, 2022
### Releases v1.6.3

1. Fix decoding error bug when using special `&` in data fields. Check [Decoding Error. two times called urlDecode in Parsing-impl.h. #17](#17)
2. Update `Packages' Patches`
khoih-prog added a commit that referenced this issue Mar 2, 2022
### Releases v1.6.3

1. Fix decoding error bug when using special `&` in data fields. Check [Decoding Error. two times called urlDecode in Parsing-impl.h. #17](#17)
2. Update `Packages' Patches`
khoih-prog added a commit that referenced this issue Mar 2, 2022
### Releases v1.6.3

1. Fix decoding error bug when using special `&` in data fields. Check [Decoding Error. two times called urlDecode in Parsing-impl.h. #17](#17)
2. Update `Packages' Patches`
@khoih-prog
Copy link
Owner

Hi @RQnet

The new WiFiWebServer releases v1.6.3 has just been published. Your contribution is noted in Contributions and Thanks

Best Regards,


Releases v1.6.3

  1. Fix decoding error bug when using special & in data fields. Check Decoding Error. two times called urlDecode in Parsing-impl.h. #17
  2. Update Packages' Patches

@khoih-prog khoih-prog added the bug Something isn't working label Mar 2, 2022
khoih-prog added a commit to khoih-prog/EthernetWebServer that referenced this issue Mar 2, 2022
### Releases v2.0.1

1. Fix decoding error bug when using special `&` in data fields. Check [Decoding Error. two times called urlDecode in Parsing-impl.h. #17](khoih-prog/WiFiWebServer#17)
2. Update `Packages' Patches`
khoih-prog added a commit to khoih-prog/EthernetWebServer that referenced this issue Mar 2, 2022
### Releases v2.0.1

1. Fix decoding error bug when using special `&` in data fields. Check [Decoding Error. two times called urlDecode in Parsing-impl.h. #17](khoih-prog/WiFiWebServer#17)
2. Update `Packages' Patches`
@RQnet
Copy link
Author

RQnet commented Mar 2, 2022

Hi @khoih-prog,
its my first time in microcontroller progrmming. so i needed a little bit of time to get knowledge. but i could get a good understand your clean coded implementation. thanks for fixing the bug and your really good work in your libraries. they are very helpfull!
Best Regards

khoih-prog added a commit to khoih-prog/EthernetWebServer_SSL that referenced this issue Mar 3, 2022
### Releases v1.7.5

1. Fix decoding error bug when using special `&` in data fields. Check [Decoding Error. two times called urlDecode in Parsing-impl.h. #17](khoih-prog/WiFiWebServer#17)
2. Update `Packages' Patches`
khoih-prog added a commit to khoih-prog/EthernetWebServer_SSL that referenced this issue Mar 3, 2022
### Releases v1.7.5

1. Fix decoding error bug when using special `&` in data fields. Check [Decoding Error. two times called urlDecode in Parsing-impl.h. #17](khoih-prog/WiFiWebServer#17)
2. Update `Packages' Patches`
khoih-prog added a commit to khoih-prog/EthernetWebServer_STM32 that referenced this issue Mar 3, 2022
### Releases v1.3.4

1. Fix decoding error bug when using special `&` in data fields. Check [Decoding Error. two times called urlDecode in Parsing-impl.h. #17](khoih-prog/WiFiWebServer#17)
khoih-prog added a commit to khoih-prog/EthernetWebServer_SSL_STM32 that referenced this issue Mar 3, 2022
### Releases v1.4.3

1. Fix decoding error bug when using special `&` in data fields. Check [Decoding Error. two times called urlDecode in Parsing-impl.h. #17](khoih-prog/WiFiWebServer#17)
khoih-prog added a commit to khoih-prog/EthernetWebServer_SSL_STM32 that referenced this issue Mar 3, 2022
### Releases v1.4.3

1. Fix decoding error bug when using special `&` in data fields. Check [Decoding Error. two times called urlDecode in Parsing-impl.h. #17](khoih-prog/WiFiWebServer#17)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants