kin-openapi
kin-openapi copied to clipboard
Concurrent map writes error in RegisterBodyEncoder
The bodyEncoders map is not thread safe. If encoders are registered in parallel, this line can cause a fatal "concurrent map writes" error. I discovered this due to having parallel tests that each used a new instance of my rest server.
This is likely low priority as this should't really ever happen in production code, but it's probably still worth making this map thread safe by adding a read-write mutex to guard all functions that access that map.