From 395d1c1149243d744fad08271f56965de4931ec2 Mon Sep 17 00:00:00 2001 From: cdelaunay Date: Mon, 5 Feb 2024 16:46:35 +0100 Subject: [PATCH 1/7] fix #asUrl for fragments with question mark character --- .../ZnUrl.class/instance/parseFrom.defaultScheme..st | 2 +- .../instance/testFragmentWithQuestionMark.st | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 repository/Zinc-Tests.package/ZnUrlTest.extension/instance/testFragmentWithQuestionMark.st diff --git a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st index a1512b11..c89449f8 100644 --- a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st +++ b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st @@ -7,7 +7,7 @@ parseFrom: string defaultScheme: defaultScheme ifTrue: [ self fragment: (self decodePercent: (string copyFrom: index + 1 to: end)). end := index - 1 ]. - (index := string indexOf: $?) > 0 + ((index := string indexOf: $?) > 0 and: [ index < (string indexOf: $#) ]) ifTrue: [ self query: (self parseQueryFrom: (ReadStream on: string from: index + 1 to: end)). end := index - 1 ]. diff --git a/repository/Zinc-Tests.package/ZnUrlTest.extension/instance/testFragmentWithQuestionMark.st b/repository/Zinc-Tests.package/ZnUrlTest.extension/instance/testFragmentWithQuestionMark.st new file mode 100644 index 00000000..4699f6d7 --- /dev/null +++ b/repository/Zinc-Tests.package/ZnUrlTest.extension/instance/testFragmentWithQuestionMark.st @@ -0,0 +1,9 @@ +*Zinc-Tests +testFragmentWithQuestionMark + + | urlString url | + urlString := 'http://www.example.com/#fragment?with?question?mark'. + url := urlString asUrl. + self assert: url segments isNil. + self deny: url hasQuery. + self assert: url asString equals: urlString \ No newline at end of file From 96fc0dc39758c754b8eaaa2a6cc92cb9711a0989 Mon Sep 17 00:00:00 2001 From: cdelaunay Date: Mon, 5 Feb 2024 16:52:21 +0100 Subject: [PATCH 2/7] adjusting fix --- .../ZnUrl.class/instance/parseFrom.defaultScheme..st | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st index c89449f8..06ddcf1f 100644 --- a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st +++ b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st @@ -1,13 +1,13 @@ parsing parseFrom: string defaultScheme: defaultScheme - | start end index | + | start end index fragmentIndex| start := 1. end := string size. - (index := string indexOf: $#) > 0 + (fragmentIndex := string indexOf: $#) > 0 ifTrue: [ - self fragment: (self decodePercent: (string copyFrom: index + 1 to: end)). - end := index - 1 ]. - ((index := string indexOf: $?) > 0 and: [ index < (string indexOf: $#) ]) + self fragment: (self decodePercent: (string copyFrom: fragmentIndex + 1 to: end)). + end := fragmentIndex - 1 ]. + ((index := string indexOf: $?) > 0 and: [ index < fragmentIndex ]) ifTrue: [ self query: (self parseQueryFrom: (ReadStream on: string from: index + 1 to: end)). end := index - 1 ]. From fd41e4527f09fc24f591ebce072ec75f15dd12dc Mon Sep 17 00:00:00 2001 From: Sven Van Caekenberghe Date: Tue, 6 Feb 2024 16:50:11 +0100 Subject: [PATCH 3/7] Bugfix to ZnMimePart>>#hasHeaders.st --- .../Zinc-HTTP.package/ZnMimePart.class/instance/hasHeaders.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repository/Zinc-HTTP.package/ZnMimePart.class/instance/hasHeaders.st b/repository/Zinc-HTTP.package/ZnMimePart.class/instance/hasHeaders.st index da007e8e..7cf4687b 100644 --- a/repository/Zinc-HTTP.package/ZnMimePart.class/instance/hasHeaders.st +++ b/repository/Zinc-HTTP.package/ZnMimePart.class/instance/hasHeaders.st @@ -1,4 +1,4 @@ testing hasHeaders - ^ headers isNotNil and: [ self headers isNotEmpty ] \ No newline at end of file + ^ headers isNotNil and: [ self headers isEmpty not ] From 9445990504d5ac6848a59896f661721858cfe595 Mon Sep 17 00:00:00 2001 From: cdelaunay Date: Mon, 12 Feb 2024 15:08:01 +0100 Subject: [PATCH 4/7] fixing tests --- .../ZnUrl.class/instance/parseFrom.defaultScheme..st | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st index 06ddcf1f..e728e650 100644 --- a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st +++ b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st @@ -3,11 +3,12 @@ parseFrom: string defaultScheme: defaultScheme | start end index fragmentIndex| start := 1. end := string size. - (fragmentIndex := string indexOf: $#) > 0 + fragmentIndex := string indexOf: $#. + (fragmentIndex) > 0 ifTrue: [ self fragment: (self decodePercent: (string copyFrom: fragmentIndex + 1 to: end)). end := fragmentIndex - 1 ]. - ((index := string indexOf: $?) > 0 and: [ index < fragmentIndex ]) + ((index := (string copyFrom: 1 to: end) indexOf: $?) > 0) ifTrue: [ self query: (self parseQueryFrom: (ReadStream on: string from: index + 1 to: end)). end := index - 1 ]. From 9d161ce9057db586f92dd7bc529fc63085b9531d Mon Sep 17 00:00:00 2001 From: cdelaunay Date: Tue, 13 Feb 2024 13:33:39 +0100 Subject: [PATCH 5/7] refining fix --- .../ZnUrl.class/instance/parseFrom.defaultScheme..st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st index e728e650..88ea831a 100644 --- a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st +++ b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st @@ -8,7 +8,7 @@ parseFrom: string defaultScheme: defaultScheme ifTrue: [ self fragment: (self decodePercent: (string copyFrom: fragmentIndex + 1 to: end)). end := fragmentIndex - 1 ]. - ((index := (string copyFrom: 1 to: end) indexOf: $?) > 0) + ((index := (string indexOf: $?)) between: 1 and: end) ifTrue: [ self query: (self parseQueryFrom: (ReadStream on: string from: index + 1 to: end)). end := index - 1 ]. From 15172fef407ef05936f7189bf8c7e6630b4dcad0 Mon Sep 17 00:00:00 2001 From: cdelaunay Date: Tue, 13 Feb 2024 14:03:51 +0100 Subject: [PATCH 6/7] cleaning fix --- .../ZnUrl.class/instance/parseFrom.defaultScheme..st | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st index 88ea831a..9ceb9315 100644 --- a/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st +++ b/repository/Zinc-Resource-Meta-Core.package/ZnUrl.class/instance/parseFrom.defaultScheme..st @@ -1,13 +1,12 @@ parsing parseFrom: string defaultScheme: defaultScheme - | start end index fragmentIndex| + | start end index | start := 1. end := string size. - fragmentIndex := string indexOf: $#. - (fragmentIndex) > 0 + (index := string indexOf: $#) > 0 ifTrue: [ - self fragment: (self decodePercent: (string copyFrom: fragmentIndex + 1 to: end)). - end := fragmentIndex - 1 ]. + self fragment: (self decodePercent: (string copyFrom: index + 1 to: end)). + end := index - 1 ]. ((index := (string indexOf: $?)) between: 1 and: end) ifTrue: [ self query: (self parseQueryFrom: (ReadStream on: string from: index + 1 to: end)). From 6ba48fdd1a6104da6e2c80b10dcd956e2adc0df0 Mon Sep 17 00:00:00 2001 From: Sven Van Caekenberghe Date: Thu, 18 Apr 2024 10:59:39 +0200 Subject: [PATCH 7/7] Update CI.yml Added Pharo 12 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 069c6998..9696e049 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - smalltalk: [ Pharo64-11, Pharo64-10 , Pharo64-9.0 , Pharo64-8.0 , Pharo64-7.0 ] + smalltalk: [ Pharo64-12, Pharo64-11, Pharo64-10 , Pharo64-9.0 , Pharo64-8.0 , Pharo64-7.0 ] name: ${{ matrix.smalltalk }} steps: - uses: actions/checkout@v3