From dcc6f41aa6ce88aa00c234c4f483f4507bea57ed Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Tue, 19 Mar 2024 15:02:02 +0530 Subject: [PATCH 01/11] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 6 +++--- ballerina/CompilerPlugin.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 6158779bd9..0645a4f0b9 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "http" -version = "2.10.11" +version = "2.10.12" authors = ["Ballerina"] keywords = ["http", "network", "service", "listener", "client"] repository = "https://github.com/ballerina-platform/module-ballerina-http" @@ -16,8 +16,8 @@ graalvmCompatible = true [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" artifactId = "http-native" -version = "2.10.11" -path = "../native/build/libs/http-native-2.10.11.jar" +version = "2.10.12" +path = "../native/build/libs/http-native-2.10.12-SNAPSHOT.jar" [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index bc7d52a0dc..5a91c3f1be 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "http-compiler-plugin" class = "io.ballerina.stdlib.http.compiler.HttpCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/http-compiler-plugin-2.10.11.jar" +path = "../compiler-plugin/build/libs/http-compiler-plugin-2.10.12-SNAPSHOT.jar" From cddf833fa8b1b727a84847769e946f3817c01518 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Tue, 19 Mar 2024 15:04:06 +0530 Subject: [PATCH 02/11] [Automated] Update the native jar versions --- ballerina/Dependencies.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index a66d21a89b..174c8e8252 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -25,7 +25,7 @@ modules = [ [[package]] org = "ballerina" name = "cache" -version = "3.7.0" +version = "3.7.1" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -76,7 +76,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.10.11" +version = "2.10.12" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -283,7 +283,7 @@ modules = [ [[package]] org = "ballerina" name = "observe" -version = "1.2.0" +version = "1.2.2" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] From 32473bcbea753eb8e78eab7df552c7229047e5e7 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Tue, 19 Mar 2024 15:58:07 +0530 Subject: [PATCH 03/11] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 2 +- ballerina/CompilerPlugin.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 0645a4f0b9..fe6be94a7d 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -17,7 +17,7 @@ graalvmCompatible = true groupId = "io.ballerina.stdlib" artifactId = "http-native" version = "2.10.12" -path = "../native/build/libs/http-native-2.10.12-SNAPSHOT.jar" +path = "../native/build/libs/http-native-2.10.12.jar" [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 5a91c3f1be..d0f2684740 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "http-compiler-plugin" class = "io.ballerina.stdlib.http.compiler.HttpCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/http-compiler-plugin-2.10.12-SNAPSHOT.jar" +path = "../compiler-plugin/build/libs/http-compiler-plugin-2.10.12.jar" From 1e0a1a446726c3917607ec25b3b3a7a3e8a4818f Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 20 Mar 2024 13:10:11 +0530 Subject: [PATCH 04/11] Remove unwanted casting --- ballerina/cookie.bal | 22 +++++++++++----------- ballerina/cookie_utils.bal | 24 ++++++++++++------------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/ballerina/cookie.bal b/ballerina/cookie.bal index 44dfdc6976..b747029d7d 100644 --- a/ballerina/cookie.bal +++ b/ballerina/cookie.bal @@ -75,14 +75,14 @@ public readonly class Cookie { public isolated function init(string name, string value, *CookieOptions options) { self.name = name.trim(); self.value = value.trim(); - var domain = options?.domain; - if domain is string { - domain = domain.trim().toLowerAscii(); - if ( domain).startsWith(".") { - domain = ( domain).substring(1, ( domain).length()); + string? domainOpt = options?.domain; + if domainOpt is string { + string domain = domainOpt.trim().toLowerAscii(); + if domain.startsWith(".") { + domain = (domain).substring(1, domain.length()); } - if ( domain).endsWith(".") { - domain = ( domain).substring(0, ( domain).length() - 1); + if domain.endsWith(".") { + domain = domain.substring(0, domain.length() - 1); } self.domain = domain; } else { @@ -94,10 +94,10 @@ public readonly class Cookie { } else { self.path = (); } - var expires = options?.expires; - if expires is string { - expires = expires.trim(); - time:Utc|error t1 = utcFromString( expires, "yyyy-MM-dd HH:mm:ss"); + var expiresOpt = options?.expires; + if expiresOpt is string { + string expires = expiresOpt.trim(); + time:Utc|error t1 = utcFromString(expires, "yyyy-MM-dd HH:mm:ss"); if t1 is time:Utc { string|error timeString = utcToString(t1, "E, dd MMM yyyy HH:mm:ss"); if timeString is string { diff --git a/ballerina/cookie_utils.bal b/ballerina/cookie_utils.bal index 94fbcd2007..b7101f5a2d 100644 --- a/ballerina/cookie_utils.bal +++ b/ballerina/cookie_utils.bal @@ -100,13 +100,13 @@ isolated function comparator(Cookie c1, Cookie c2) returns int { isolated function getClone(Cookie cookie, time:Utc createdTime, time:Utc lastAccessedTime) returns Cookie { CookieOptions options = {}; if cookie.domain is string { - options.domain = cookie.domain; + options.domain = cookie.domain; } if cookie.path is string { - options.path = cookie.path; + options.path = cookie.path; } if cookie.expires is string { - options.expires = cookie.expires; + options.expires = cookie.expires; } options.maxAge = cookie.maxAge; options.httpOnly = cookie.httpOnly; @@ -120,10 +120,10 @@ isolated function getClone(Cookie cookie, time:Utc createdTime, time:Utc lastAcc isolated function getCloneWithExpiresAndMaxAge(Cookie cookie, string expires, int maxAge) returns Cookie { CookieOptions options = {}; if cookie.domain is string { - options.domain = cookie.domain; + options.domain = cookie.domain; } if cookie.path is string { - options.path = cookie.path; + options.path = cookie.path; } options.expires = expires; options.maxAge = maxAge; @@ -138,10 +138,10 @@ isolated function getCloneWithExpiresAndMaxAge(Cookie cookie, string expires, in isolated function getCloneWithPath(Cookie cookie, string path) returns Cookie { CookieOptions options = {}; if cookie.domain is string { - options.domain = cookie.domain; + options.domain = cookie.domain; } if cookie.expires is string { - options.expires = cookie.expires; + options.expires = cookie.expires; } options.path = path; options.maxAge = cookie.maxAge; @@ -156,10 +156,10 @@ isolated function getCloneWithPath(Cookie cookie, string path) returns Cookie { isolated function getCloneWithDomainAndHostOnly(Cookie cookie, string domain, boolean hostOnly) returns Cookie { CookieOptions options = {}; if cookie.path is string { - options.path = cookie.path; + options.path = cookie.path; } if cookie.expires is string { - options.expires = cookie.expires; + options.expires = cookie.expires; } options.domain = domain; options.maxAge = cookie.maxAge; @@ -174,13 +174,13 @@ isolated function getCloneWithDomainAndHostOnly(Cookie cookie, string domain, bo isolated function getCloneWithHostOnly(Cookie cookie, boolean hostOnly) returns Cookie { CookieOptions options = {}; if cookie.path is string { - options.path = cookie.path; + options.path = cookie.path; } if cookie.domain is string { - options.domain = cookie.domain; + options.domain = cookie.domain; } if cookie.expires is string { - options.expires = cookie.expires; + options.expires = cookie.expires; } options.maxAge = cookie.maxAge; options.httpOnly = cookie.httpOnly; From 620a1fee9743c59847af522922439cecacd9cd08 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 20 Mar 2024 13:10:35 +0530 Subject: [PATCH 05/11] Fix finding identical cookie --- ballerina/cookie_cookieStore.bal | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ballerina/cookie_cookieStore.bal b/ballerina/cookie_cookieStore.bal index a87b3ff351..4e6fdafef3 100644 --- a/ballerina/cookie_cookieStore.bal +++ b/ballerina/cookie_cookieStore.bal @@ -53,16 +53,15 @@ public isolated class CookieStore { path = requestPath.substring(0, index); } - Cookie? identicalCookie = self.getIdenticalCookie(cookie); Cookie? domainValidated = matchDomain(cookie, domain, cookieConfig); if domainValidated is () { return; } - Cookie? pathValidated = matchPath( domainValidated, path, cookieConfig); + Cookie? pathValidated = matchPath(domainValidated, path, cookieConfig); if pathValidated is () { return; } - Cookie? validated = validateExpiresAttribute( pathValidated); + Cookie? validated = validateExpiresAttribute(pathValidated); if validated is () { return; } @@ -70,6 +69,7 @@ public isolated class CookieStore { return; } lock { + Cookie? identicalCookie = self.getIdenticalCookie(validated); if validated.isPersistent() { var persistentCookieHandler = self.persistentCookieHandler; if persistentCookieHandler is PersistentCookieHandler { From d81495916d9ce8d3b095ee839c7bf4e3f68ff026 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 20 Mar 2024 13:59:00 +0530 Subject: [PATCH 06/11] Add test cases --- .../tests/http_identical_cookies.bal | 139 ++++++++++++++++++ .../tests/test_service_ports.bal | 2 + 2 files changed, 141 insertions(+) create mode 100644 ballerina-tests/http-advanced-tests/tests/http_identical_cookies.bal diff --git a/ballerina-tests/http-advanced-tests/tests/http_identical_cookies.bal b/ballerina-tests/http-advanced-tests/tests/http_identical_cookies.bal new file mode 100644 index 0000000000..3969b60c1b --- /dev/null +++ b/ballerina-tests/http-advanced-tests/tests/http_identical_cookies.bal @@ -0,0 +1,139 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.org). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/http; +import ballerina/test; + +service /api on new http:Listener(identicalCookiePort) { + + resource function get .(@http:Header string? cookie) returns http:Response { + http:Response res = new; + http:Cookie resCookie = new ("cookie", "default", path = "/api"); + res.addCookie(resCookie); + res.setTextPayload("Hello, World!"); + if cookie is string { + res.setHeader("Req-Cookies", cookie); + } + return res; + } + + resource function get foo(@http:Header string? cookie, string value = "foo") returns http:Response { + http:Response res = new; + http:Cookie resCookie = new ("cookie", value, path = "/api/foo"); + res.addCookie(resCookie); + res.setTextPayload("Hello, World!"); + if cookie is string { + res.setHeader("Req-Cookies", cookie); + } + return res; + } + + resource function get bar(@http:Header string? cookie) returns http:Response { + http:Response res = new; + http:Cookie resCookie = new ("cookie", "bar", path = "/api/bar"); + res.addCookie(resCookie); + res.setTextPayload("Hello, World!"); + if cookie is string { + res.setHeader("Req-Cookies", cookie); + } + return res; + } + + resource function 'default [string... path](@http:Header string? cookie) returns http:Response { + http:Response res = new; + http:Cookie resCookie = new ("cookie", string:'join("/", ...path), path = "/api/"); + res.addCookie(resCookie); + res.setTextPayload("Hello, World!"); + if cookie is string { + res.setHeader("Req-Cookies", cookie); + } + return res; + } +} + +@test:Config {} +function testIdenticalCookieOverwrite1() returns error? { + http:Client cookieClient = check new (string `localhost:${identicalCookiePort}`, + cookieConfig = { + enabled: true + } + ); + http:Response res = check cookieClient->/api/foo; + test:assertFalse(res.hasHeader("Req-Cookies"), "Req-Cookies header should not be present"); + + res = check cookieClient->/api/foo(value = "random"); + test:assertEquals(res.getHeader("Req-Cookies"), "cookie=foo", "Req-Cookies header value mismatched"); + + res = check cookieClient->/api/foo; + test:assertEquals(res.getHeader("Req-Cookies"), "cookie=random", "Req-Cookies header value mismatched"); +} + +@test:Config {} +function testIdenticalCookieOverwrite2() returns error? { + http:Client cookieClient = check new (string `localhost:${identicalCookiePort}`, + cookieConfig = { + enabled: true + } + ); + http:Response res = check cookieClient->/api/baz; + test:assertFalse(res.hasHeader("Req-Cookies"), "Req-Cookies header should not be present"); + + res = check cookieClient->/api/foo/baz(); + test:assertEquals(res.getHeader("Req-Cookies"), "cookie=baz", "Req-Cookies header value mismatched"); + + res = check cookieClient->/api/baz; + test:assertEquals(res.getHeader("Req-Cookies"), "cookie=foo/baz", "Req-Cookies header value mismatched"); +} + +@test:Config {} +function testNonIdenticalCookieWithSameName1() returns error? { + http:Client cookieClient = check new (string `localhost:${identicalCookiePort}`, + cookieConfig = { + enabled: true + } + ); + http:Response res = check cookieClient->/api; + test:assertFalse(res.hasHeader("Req-Cookies"), "Req-Cookies header should not be present"); + + res = check cookieClient->/api/foo; + test:assertEquals(res.getHeader("Req-Cookies"), "cookie=default", "Req-Cookies header value mismatched"); + + res = check cookieClient->/api/foo(value = "new"); + test:assertEquals(res.getHeader("Req-Cookies"), "cookie=default; cookie=foo", "Req-Cookies header value mismatched"); + + res = check cookieClient->/api/foo; + test:assertEquals(res.getHeader("Req-Cookies"), "cookie=default; cookie=new", "Req-Cookies header value mismatched"); +} + +@test:Config {} +function testNonIdenticalCookieWithSameName2() returns error? { + http:Client cookieClient = check new (string `localhost:${identicalCookiePort}`, + cookieConfig = { + enabled: true + } + ); + http:Response res = check cookieClient->/api; + test:assertFalse(res.hasHeader("Req-Cookies"), "Req-Cookies header should not be present"); + + res = check cookieClient->/api/baz; + test:assertEquals(res.getHeader("Req-Cookies"), "cookie=default", "Req-Cookies header value mismatched"); + + res = check cookieClient->/api/baz/foo; + test:assertEquals(res.getHeader("Req-Cookies"), "cookie=default; cookie=baz", "Req-Cookies header value mismatched"); + + res = check cookieClient->/api/baz; + test:assertEquals(res.getHeader("Req-Cookies"), "cookie=default; cookie=baz/foo", "Req-Cookies header value mismatched"); +} diff --git a/ballerina-tests/http-advanced-tests/tests/test_service_ports.bal b/ballerina-tests/http-advanced-tests/tests/test_service_ports.bal index 9acfbc9e9d..7176d4045f 100644 --- a/ballerina-tests/http-advanced-tests/tests/test_service_ports.bal +++ b/ballerina-tests/http-advanced-tests/tests/test_service_ports.bal @@ -40,3 +40,5 @@ const int serviceMediaTypeSubtypePrefixPort = 9579; const int statusCodeErrorUseCasePort = 9090; const int statusCodeErrorPort = 9092; + +const int identicalCookiePort = 9093; From 1bb8dec8de4d9d5c5f870ef69a000331064733e2 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 20 Mar 2024 14:00:10 +0530 Subject: [PATCH 07/11] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 2 +- ballerina/CompilerPlugin.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index fe6be94a7d..0645a4f0b9 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -17,7 +17,7 @@ graalvmCompatible = true groupId = "io.ballerina.stdlib" artifactId = "http-native" version = "2.10.12" -path = "../native/build/libs/http-native-2.10.12.jar" +path = "../native/build/libs/http-native-2.10.12-SNAPSHOT.jar" [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index d0f2684740..5a91c3f1be 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "http-compiler-plugin" class = "io.ballerina.stdlib.http.compiler.HttpCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/http-compiler-plugin-2.10.12.jar" +path = "../compiler-plugin/build/libs/http-compiler-plugin-2.10.12-SNAPSHOT.jar" From de1ae3643ed87d4d5d2091048b5e735e1daa92ad Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 20 Mar 2024 14:01:56 +0530 Subject: [PATCH 08/11] [Automated] Update the native jar versions --- ballerina-tests/http-advanced-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-advanced-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-client-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-dispatching-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-interceptor-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-misc-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-resiliency-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-security-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-service-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-test-common/Ballerina.toml | 2 +- ballerina-tests/http-test-common/Dependencies.toml | 2 +- ballerina-tests/http2-tests/Ballerina.toml | 6 +++--- ballerina-tests/http2-tests/Dependencies.toml | 6 +++--- 13 files changed, 35 insertions(+), 35 deletions(-) diff --git a/ballerina-tests/http-advanced-tests/Ballerina.toml b/ballerina-tests/http-advanced-tests/Ballerina.toml index 53f66a65b5..79b45921f0 100644 --- a/ballerina-tests/http-advanced-tests/Ballerina.toml +++ b/ballerina-tests/http-advanced-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_advanced_tests" -version = "2.10.11" +version = "2.10.12" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.10.11" +version = "2.10.12" [platform.java17] graalvmCompatible = true [[platform.java17.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.10.11.jar" +path = "../../test-utils/build/libs/http-test-utils-2.10.12-SNAPSHOT.jar" diff --git a/ballerina-tests/http-advanced-tests/Dependencies.toml b/ballerina-tests/http-advanced-tests/Dependencies.toml index b12ab29881..de2ec81227 100644 --- a/ballerina-tests/http-advanced-tests/Dependencies.toml +++ b/ballerina-tests/http-advanced-tests/Dependencies.toml @@ -72,7 +72,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -105,7 +105,7 @@ modules = [ [[package]] org = "ballerina" name = "http_advanced_tests" -version = "2.10.11" +version = "2.10.12" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "file"}, @@ -125,7 +125,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-client-tests/Ballerina.toml b/ballerina-tests/http-client-tests/Ballerina.toml index 2639b61972..4846ecc167 100644 --- a/ballerina-tests/http-client-tests/Ballerina.toml +++ b/ballerina-tests/http-client-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_client_tests" -version = "2.10.11" +version = "2.10.12" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.10.11" +version = "2.10.12" [platform.java17] graalvmCompatible = true [[platform.java17.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.10.11.jar" +path = "../../test-utils/build/libs/http-test-utils-2.10.12-SNAPSHOT.jar" diff --git a/ballerina-tests/http-dispatching-tests/Ballerina.toml b/ballerina-tests/http-dispatching-tests/Ballerina.toml index c8dba38260..c609677545 100644 --- a/ballerina-tests/http-dispatching-tests/Ballerina.toml +++ b/ballerina-tests/http-dispatching-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_dispatching_tests" -version = "2.10.11" +version = "2.10.12" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.10.11" +version = "2.10.12" [platform.java17] graalvmCompatible = true [[platform.java17.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.10.11.jar" +path = "../../test-utils/build/libs/http-test-utils-2.10.12-SNAPSHOT.jar" diff --git a/ballerina-tests/http-interceptor-tests/Ballerina.toml b/ballerina-tests/http-interceptor-tests/Ballerina.toml index f64b8ff450..8936858c01 100644 --- a/ballerina-tests/http-interceptor-tests/Ballerina.toml +++ b/ballerina-tests/http-interceptor-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_interceptor_tests" -version = "2.10.11" +version = "2.10.12" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.10.11" +version = "2.10.12" [platform.java17] graalvmCompatible = true [[platform.java17.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.10.11.jar" +path = "../../test-utils/build/libs/http-test-utils-2.10.12-SNAPSHOT.jar" diff --git a/ballerina-tests/http-misc-tests/Ballerina.toml b/ballerina-tests/http-misc-tests/Ballerina.toml index 35902f372e..b8c8fa72b2 100644 --- a/ballerina-tests/http-misc-tests/Ballerina.toml +++ b/ballerina-tests/http-misc-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_misc_tests" -version = "2.10.11" +version = "2.10.12" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.10.11" +version = "2.10.12" [platform.java17] graalvmCompatible = true [[platform.java17.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.10.11.jar" +path = "../../test-utils/build/libs/http-test-utils-2.10.12-SNAPSHOT.jar" diff --git a/ballerina-tests/http-resiliency-tests/Ballerina.toml b/ballerina-tests/http-resiliency-tests/Ballerina.toml index a9872db65e..9e1bd8e56c 100644 --- a/ballerina-tests/http-resiliency-tests/Ballerina.toml +++ b/ballerina-tests/http-resiliency-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_resiliency_tests" -version = "2.10.11" +version = "2.10.12" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.10.11" +version = "2.10.12" [platform.java17] graalvmCompatible = true [[platform.java17.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.10.11.jar" +path = "../../test-utils/build/libs/http-test-utils-2.10.12-SNAPSHOT.jar" diff --git a/ballerina-tests/http-security-tests/Ballerina.toml b/ballerina-tests/http-security-tests/Ballerina.toml index 77525521a2..9c8e662844 100644 --- a/ballerina-tests/http-security-tests/Ballerina.toml +++ b/ballerina-tests/http-security-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_security_tests" -version = "2.10.11" +version = "2.10.12" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.10.11" +version = "2.10.12" [platform.java17] graalvmCompatible = true [[platform.java17.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.10.11.jar" +path = "../../test-utils/build/libs/http-test-utils-2.10.12-SNAPSHOT.jar" diff --git a/ballerina-tests/http-service-tests/Ballerina.toml b/ballerina-tests/http-service-tests/Ballerina.toml index 75f0cb174c..bd8f191359 100644 --- a/ballerina-tests/http-service-tests/Ballerina.toml +++ b/ballerina-tests/http-service-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_service_tests" -version = "2.10.11" +version = "2.10.12" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.10.11" +version = "2.10.12" [platform.java17] graalvmCompatible = true [[platform.java17.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.10.11.jar" +path = "../../test-utils/build/libs/http-test-utils-2.10.12-SNAPSHOT.jar" diff --git a/ballerina-tests/http-test-common/Ballerina.toml b/ballerina-tests/http-test-common/Ballerina.toml index 1c0b1310ce..c138dd1d53 100644 --- a/ballerina-tests/http-test-common/Ballerina.toml +++ b/ballerina-tests/http-test-common/Ballerina.toml @@ -1,4 +1,4 @@ [package] org = "ballerina" name = "http_test_common" -version = "2.10.11" +version = "2.10.12" diff --git a/ballerina-tests/http-test-common/Dependencies.toml b/ballerina-tests/http-test-common/Dependencies.toml index 0f18fe51e9..5e193415ee 100644 --- a/ballerina-tests/http-test-common/Dependencies.toml +++ b/ballerina-tests/http-test-common/Dependencies.toml @@ -10,7 +10,7 @@ distribution-version = "2201.8.0" [[package]] org = "ballerina" name = "http_test_common" -version = "2.10.11" +version = "2.10.12" dependencies = [ {org = "ballerina", name = "lang.string"}, {org = "ballerina", name = "mime"}, diff --git a/ballerina-tests/http2-tests/Ballerina.toml b/ballerina-tests/http2-tests/Ballerina.toml index 70a800615e..59cdb7a086 100644 --- a/ballerina-tests/http2-tests/Ballerina.toml +++ b/ballerina-tests/http2-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http2_tests" -version = "2.10.11" +version = "2.10.12" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.10.11" +version = "2.10.12" [platform.java17] graalvmCompatible = true [[platform.java17.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.10.11.jar" +path = "../../test-utils/build/libs/http-test-utils-2.10.12-SNAPSHOT.jar" diff --git a/ballerina-tests/http2-tests/Dependencies.toml b/ballerina-tests/http2-tests/Dependencies.toml index 2fc6e4c534..b83cb7e6b2 100644 --- a/ballerina-tests/http2-tests/Dependencies.toml +++ b/ballerina-tests/http2-tests/Dependencies.toml @@ -69,7 +69,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http2_tests" -version = "2.10.11" +version = "2.10.12" dependencies = [ {org = "ballerina", name = "file"}, {org = "ballerina", name = "http"}, @@ -121,7 +121,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, From 0a16552dc4868937fb83703a454b2d7af7892cf5 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 20 Mar 2024 14:07:39 +0530 Subject: [PATCH 09/11] Update changelog --- changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog.md b/changelog.md index 0709df8ea6..2552840dec 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,12 @@ This file contains all the notable changes done to the Ballerina HTTP package th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- [Fix the inconsistency in overwriting identical cookies](https://github.com/ballerina-platform/ballerina-library/issues/6194) + ## [2.10.11] - 2024-03-13 ### Changed From a1fb985b5c412ef8d60117f7543158d8cbbddbbf Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 20 Mar 2024 14:13:19 +0530 Subject: [PATCH 10/11] [Automated] Update the native jar versions --- ballerina-tests/http-client-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-dispatching-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-interceptor-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-misc-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-resiliency-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-security-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-service-tests/Dependencies.toml | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ballerina-tests/http-client-tests/Dependencies.toml b/ballerina-tests/http-client-tests/Dependencies.toml index 6f631cf8cb..31605dc3df 100644 --- a/ballerina-tests/http-client-tests/Dependencies.toml +++ b/ballerina-tests/http-client-tests/Dependencies.toml @@ -69,7 +69,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_client_tests" -version = "2.10.11" +version = "2.10.12" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, @@ -121,7 +121,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-dispatching-tests/Dependencies.toml b/ballerina-tests/http-dispatching-tests/Dependencies.toml index 919c23871e..17978608a8 100644 --- a/ballerina-tests/http-dispatching-tests/Dependencies.toml +++ b/ballerina-tests/http-dispatching-tests/Dependencies.toml @@ -69,7 +69,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_dispatching_tests" -version = "2.10.11" +version = "2.10.12" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, @@ -124,7 +124,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-interceptor-tests/Dependencies.toml b/ballerina-tests/http-interceptor-tests/Dependencies.toml index bddf9320a6..98035d8644 100644 --- a/ballerina-tests/http-interceptor-tests/Dependencies.toml +++ b/ballerina-tests/http-interceptor-tests/Dependencies.toml @@ -66,7 +66,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -99,7 +99,7 @@ modules = [ [[package]] org = "ballerina" name = "http_interceptor_tests" -version = "2.10.11" +version = "2.10.12" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "http_test_common"}, @@ -115,7 +115,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-misc-tests/Dependencies.toml b/ballerina-tests/http-misc-tests/Dependencies.toml index 3694c12d7b..913fdbe5d6 100644 --- a/ballerina-tests/http-misc-tests/Dependencies.toml +++ b/ballerina-tests/http-misc-tests/Dependencies.toml @@ -66,7 +66,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -99,7 +99,7 @@ modules = [ [[package]] org = "ballerina" name = "http_misc_tests" -version = "2.10.11" +version = "2.10.12" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "http_test_common"}, @@ -118,7 +118,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-resiliency-tests/Dependencies.toml b/ballerina-tests/http-resiliency-tests/Dependencies.toml index e5e0819c92..ad0ddfa58a 100644 --- a/ballerina-tests/http-resiliency-tests/Dependencies.toml +++ b/ballerina-tests/http-resiliency-tests/Dependencies.toml @@ -66,7 +66,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -99,7 +99,7 @@ modules = [ [[package]] org = "ballerina" name = "http_resiliency_tests" -version = "2.10.11" +version = "2.10.12" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "http_test_common"}, @@ -116,7 +116,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-security-tests/Dependencies.toml b/ballerina-tests/http-security-tests/Dependencies.toml index f36b8cd930..5616ba9792 100644 --- a/ballerina-tests/http-security-tests/Dependencies.toml +++ b/ballerina-tests/http-security-tests/Dependencies.toml @@ -69,7 +69,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_security_tests" -version = "2.10.11" +version = "2.10.12" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "http"}, @@ -120,7 +120,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-service-tests/Dependencies.toml b/ballerina-tests/http-service-tests/Dependencies.toml index 33a35553c9..f59427d5ab 100644 --- a/ballerina-tests/http-service-tests/Dependencies.toml +++ b/ballerina-tests/http-service-tests/Dependencies.toml @@ -69,7 +69,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_service_tests" -version = "2.10.11" +version = "2.10.12" dependencies = [ {org = "ballerina", name = "file"}, {org = "ballerina", name = "http"}, @@ -121,7 +121,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.10.11" +version = "2.10.12" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, From ff0155d86f4ce778f9d5035d128957686217a42e Mon Sep 17 00:00:00 2001 From: Krishnananthalingam Tharmigan <63336800+TharmiganK@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:25:57 +0530 Subject: [PATCH 11/11] Update ballerina/cookie_cookieStore.bal Co-authored-by: Dilan Sachintha Nayanajith --- ballerina/cookie_cookieStore.bal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ballerina/cookie_cookieStore.bal b/ballerina/cookie_cookieStore.bal index 4e6fdafef3..156e4d610f 100644 --- a/ballerina/cookie_cookieStore.bal +++ b/ballerina/cookie_cookieStore.bal @@ -65,7 +65,7 @@ public isolated class CookieStore { if validated is () { return; } - if !((url.startsWith(HTTP) && validated.httpOnly) || validated.httpOnly == false) { + if !((url.startsWith(HTTP) && validated.httpOnly) || !validated.httpOnly) { return; } lock {