Skip to content

Commit

Permalink
Merge pull request #73 from ba-st/push_up_content_language
Browse files Browse the repository at this point in the history
Move addContentLanguage: and contentLanguageTags to ZnMessage
  • Loading branch information
mtabacman authored Aug 23, 2024
2 parents 4a1065f + 0307b7d commit 5bf3ea2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
18 changes: 18 additions & 0 deletions source/Hyperspace-Extensions/ZnMessage.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : 'ZnMessage' }

{ #category : '*Hyperspace-Extensions' }
ZnMessage >> addContentLanguage: aLanguageTag [

self headers at: 'Content-Language' add: aLanguageTag
]

{ #category : '*Hyperspace-Extensions' }
ZnMessage >> contentLanguageTags [

| headerValue |

headerValue := self headers at: 'Content-Language' ifAbsent: [ ^ #() ].
^ headerValue isArray
ifTrue: [ headerValue collect: #asLanguageTag ]
ifFalse: [ Array with: headerValue asLanguageTag ]
]
17 changes: 0 additions & 17 deletions source/Hyperspace-Extensions/ZnResponse.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ ZnResponse >> addCachingDirective: aDirective [
self headers at: 'Cache-Control' add: aDirective
]

{ #category : '*Hyperspace-Extensions' }
ZnResponse >> addContentLanguage: aLanguageTag [

self headers at: 'Content-Language' add: aLanguageTag
]

{ #category : '*Hyperspace-Extensions' }
ZnResponse >> addLink: aLink [

Expand All @@ -35,17 +29,6 @@ ZnResponse >> cachingDirectives [
ifFalse: [ Array with: directives ]
]

{ #category : '*Hyperspace-Extensions' }
ZnResponse >> contentLanguageTags [

| headerValue |

headerValue := self headers at: 'Content-Language' ifAbsent: [ ^ #() ].
^ headerValue isArray
ifTrue: [ headerValue collect: #asLanguageTag ]
ifFalse: [ Array with: headerValue asLanguageTag ]
]

{ #category : '*Hyperspace-Extensions' }
ZnResponse >> entityTag [

Expand Down

0 comments on commit 5bf3ea2

Please sign in to comment.