Kong / unirest-java

Unirest in Java: Simplified, lightweight HTTP client library.
http://kong.github.io/unirest-java/
MIT License
2.61k stars 594 forks source link

Options require synchronization #164

Closed dmitrymurashenkov closed 5 years ago

dmitrymurashenkov commented 8 years ago

It seems that Options class can be accessed from several threads, but currently it uses HashMap and non-synchronized methods. This may lead to concurrency issues.

ryber commented 5 years ago

You shouldn't be changing the static config a lot anyway. Recommendation is once per JVM startup. synchronized methods have their own issues and can cause locks. Unirest 2 supports multiple configs