Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove Header>>+ method

  • Loading branch information...
commit 1ae082f3ed82aa5f7cf42861e2f39061e17e4c7c 1 parent 22a629c
Ladislav Marek authored
Showing with 6 additions and 10 deletions.
  1. +1 −7 libs/Header.st
  2. +5 −3 libs/Parsing/HeadersParser.st
8 libs/Header.st
View
@@ -97,12 +97,6 @@ Object subclass: Header [
and: [aHeader value = value]]
]
- + aHeader [
- <category: 'arithmetic'>
-
- ^self class name: name value: value, ', ', aHeader value
- ]
-
hash [
<category: 'testing'>
@@ -138,7 +132,7 @@ Object subclass: Header [
withValue: aString [
<category: 'copying'>
- ^self class name: name value: value, aString
+ ^self class name: name value: aString
]
printOn: aStream [
8 libs/Parsing/HeadersParser.st
View
@@ -52,11 +52,13 @@ Namespace current: Parsing [
line = ''] whileFalse: [
(header isNil not and: [line first = Character space or: [line first = Character tab]])
ifTrue: [
- headers at: header name put: (header withValue: line trimSeparators)]
+ header := header withValue: header value, ' ', line trimSeparators]
ifFalse: [
header := Header fromString: line.
- headers at: header name ifPresent: [ :v | header := v + header].
- headers at: header name put: header].
+ headers at: header name ifPresent: [ :prevHeader |
+ header := header withValue: prevHeader value, ', ', header value]].
+
+ headers at: header name put: header.
].
^headers
Please sign in to comment.
Something went wrong with that request. Please try again.