Http request might contains a few "Set-Cookie" headers with different values. Current code merge headers with same key using ','. However, Some 'Set-Cookie' header value contains ',' as well. The issue is that after we store "Set-Cookie" headers to the scene, it's possible that we cant split them properly when we load from the scene. It will cause some matching function failure. The proper way to do is always use multi-map to store Http headers but it requires significant refactoring and will also make the code over complicated. One workaround is to encode all headers before we merge headers but it will lose readability for headers in the scene. So I'd like just encode "Set-Cookie" headers but not any other headers.
Also, I added some unit tests and enable TestNG in build.gradle
Http request might contains a few "Set-Cookie" headers with different values. Current code merge headers with same key using ','. However, Some 'Set-Cookie' header value contains ',' as well. The issue is that after we store "Set-Cookie" headers to the scene, it's possible that we cant split them properly when we load from the scene. It will cause some matching function failure. The proper way to do is always use multi-map to store Http headers but it requires significant refactoring and will also make the code over complicated. One workaround is to encode all headers before we merge headers but it will lose readability for headers in the scene. So I'd like just encode "Set-Cookie" headers but not any other headers.
Also, I added some unit tests and enable TestNG in build.gradle