forked from SeasideSt/Seaside
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
43 additions
and
36 deletions.
There are no files selected for viewing
7 changes: 4 additions & 3 deletions
7
...sitory/Seaside-Zinc-Core.package/ZnZincServerAdaptor.class/instance/requestAddressFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
converting-request | ||
requestAddressFor: aZincRequest | ||
^ aZincRequest headers | ||
at: ZnConstants remoteAddressHeader | ||
ifAbsent: [ nil ] | ||
|
||
^ aZincRequest headers | ||
at: ZnConstants remoteAddressHeader | ||
ifAbsent: [ nil ] |
18 changes: 10 additions & 8 deletions
18
repository/Seaside-Zinc-Core.package/ZnZincServerAdaptor.class/instance/requestBodyFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
converting-request | ||
requestBodyFor: aZincRequest | ||
^ (aZincRequest method ~= #TRACE | ||
and: [ aZincRequest hasEntity | ||
and: [ aZincRequest entity isEmpty not | ||
and: [ (aZincRequest entity contentType matches: ZnMimeType applicationFormUrlEncoded) not | ||
and: [ (aZincRequest entity contentType matches: ZnMimeType multiPartFormData) not ] ] ] ]) | ||
ifTrue: [ | ||
|
||
^ (aZincRequest method ~= #TRACE and: [ | ||
aZincRequest hasEntity and: [ | ||
aZincRequest entity isEmpty not and: [ | ||
(aZincRequest entity contentType matches: | ||
ZnMimeType applicationFormUrlEncoded) not and: [ | ||
(aZincRequest entity contentType matches: | ||
ZnMimeType multiPartFormData) not ] ] ] ]) | ||
ifTrue: [ | ||
"Seaside wants to do its own text conversions" | ||
aZincRequest entity bytes asString ] | ||
ifFalse: [ | ||
String new ] | ||
ifFalse: [ '' ] |
23 changes: 12 additions & 11 deletions
23
repository/Seaside-Zinc-Core.package/ZnZincServerAdaptor.class/instance/requestFieldsFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
converting-request | ||
requestFieldsFor: aZincRequest | ||
|
||
| fields | | ||
fields := WARequestFields new. | ||
(aZincRequest method = #POST and: [ aZincRequest hasEntity ]) | ||
ifTrue: [ | ||
(aZincRequest entity contentType matches: ZnMimeType applicationFormUrlEncoded) | ||
ifTrue: [ | ||
fields addAll: (aZincRequest entity class = ZnStreamingEntity | ||
ifTrue: [ | ||
ZnApplicationFormUrlEncodedEntity new | ||
readFrom: aZincRequest entity stream; | ||
fields ] | ||
ifFalse: [ aZincRequest entity fields ]) ]. | ||
(aZincRequest entity contentType matches: ZnMimeType multiPartFormData) | ||
ifTrue: [ | ||
fields addAll: (self convertMultipart: aZincRequest entity) ] ]. | ||
(aZincRequest entity contentType matches: | ||
ZnMimeType applicationFormUrlEncoded) ifTrue: [ | ||
fields addAll: (aZincRequest entity class = ZnStreamingEntity | ||
ifTrue: [ | ||
ZnApplicationFormUrlEncodedEntity new | ||
readFrom: aZincRequest entity stream; | ||
fields ] | ||
ifFalse: [ aZincRequest entity fields ]) ]. | ||
(aZincRequest entity contentType matches: | ||
ZnMimeType multiPartFormData) ifTrue: [ | ||
fields addAll: (self convertMultipart: aZincRequest entity) ] ]. | ||
^ fields |
8 changes: 5 additions & 3 deletions
8
...sitory/Seaside-Zinc-Core.package/ZnZincServerAdaptor.class/instance/requestHeadersFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
converting-request | ||
requestHeadersFor: aZincRequest | ||
|
||
| fields | | ||
fields := Dictionary new. | ||
aZincRequest headersDo: [ :key :value | | ||
| keyLowercase combinedValue | | ||
keyLowercase := key asLowercase. | ||
combinedValue := fields at: keyLowercase | ||
ifPresent: [ :presentValue | presentValue , ',' , value ] | ||
ifAbsent: [ value ]. | ||
combinedValue := fields | ||
at: keyLowercase | ||
ifPresent: [ :presentValue | presentValue , ',' , value ] | ||
ifAbsent: [ value ]. | ||
fields at: keyLowercase put: combinedValue ]. | ||
^ fields |
22 changes: 11 additions & 11 deletions
22
repository/Seaside-Zinc-Core.package/ZnZincServerAdaptor.class/instance/requestUrlFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
converting-request | ||
requestUrlFor: aZincRequest | ||
|
||
| zincUrl seasideUrl | | ||
zincUrl := aZincRequest url. | ||
seasideUrl := WAUrl new | ||
scheme: zincUrl schemeOrDefault greaseString; | ||
host: zincUrl host; | ||
port: zincUrl port; | ||
fragment: zincUrl fragment. | ||
scheme: zincUrl schemeOrDefault greaseString; | ||
host: zincUrl host; | ||
port: zincUrl port; | ||
fragment: zincUrl fragment. | ||
zincUrl hasPath ifTrue: [ | ||
zincUrl isDirectoryPath | ||
ifTrue: [ "last path segment is $/ or #/" | ||
zincUrl pathSegments | ||
"GemStone/S currently does not support #allButLastDo:" | ||
allButLast do: [ :each | seasideUrl rawAddToPath: each ]. | ||
seasideUrl slash: true ] | ||
ifTrue: [ | ||
"last path segment is $/ or #/" | ||
zincUrl pathSegments allButLast do: [ :each | seasideUrl rawAddToPath: each ]. | ||
"GemStone/S currently does not support #allButLastDo:" | ||
seasideUrl slash: true ] | ||
ifFalse: [ seasideUrl rawAddAllToPath: zincUrl pathSegments ] ]. | ||
zincUrl | ||
queryDo: [ :key :value | seasideUrl addField: key value: value ]. | ||
zincUrl queryDo: [ :key :value | seasideUrl addField: key value: value ]. | ||
^ seasideUrl |
1 change: 1 addition & 0 deletions
1
...sitory/Seaside-Zinc-Core.package/ZnZincServerAdaptor.class/instance/requestVersionFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
converting-request | ||
requestVersionFor: aZincRequest | ||
|
||
^ WAHttpVersion fromString: aZincRequest requestLine version |