[Seaside] Seaside-REST, PUT, and the Server adaptors

Tobias Pape Das.Linux at gmx.de
Fri Apr 15 10:56:51 UTC 2011


Am 2011-04-15 um 12:13 schrieb Tobias Pape:
>>> 
>>> put was done using:
>>> curl -v -X PUT -T Seaside-GemStone-REST-Core-topa.2.mcz http://localhost:8888/rest/
>> 
>> Thanks, I'll try that. Can you tell me which version of Swazoo you use?
> 
> the one that is installed with the 3.0.4 Seaside Version when requesting 'Seaside-Adaptors-Swazoo'
> 
> I'll have a look at some code I and some guys wrote two 
> years ago, I think we already 'fixed' that
> 

Ok, I just forgot my own Email to this list:
<03209795-18BF-41DF-864F-470DC8895949 at gmx.de>
(http://permalink.gmane.org/gmane.comp.lang.smalltalk.squeak.seaside/24213)

The fix is in:
http://code.google.com/p/glassdb/issues/detail?id=261

> HTTPPut implements #readFrom: wich is never sent.
> However, it should implement #for:readFrom: in order 
> to  set its field as done in #readFrom:.
> 
> To make a long story short:
> 
> change 
> #readFrom: aStream
> to
> #for: aRequestLine readFrom: aStream
> 
> and do the same for the super call.

That is:

HTTPPut
-readFrom: aStream 
+for: aRequestLine readFrom: aStream
	| contentTypeField |
-	super readFrom: aStream.
+	super for: aRequestLine readFrom: aStream.
	contentTypeField := self headers fieldOfClass: ContentTypeField
				ifNone: [SwazooHTTPPutError raiseSignal: 'Missing Content-Type'].
	contentTypeField mediaType = 'application/octet-stream' 
		ifTrue: [self octetDataFrom: aStream]
		ifFalse: [self urlencodedDataFrom: aStream].
	^self

So Long,
	-Tobias


More information about the seaside mailing list