[Pharo-project] 1.3-Core

Sven Van Caekenberghe sven at beta9.be
Fri May 13 10:24:48 CEST 2011


On 12 May 2011, at 22:50, Alexandre Bergel wrote:

>> Can you try a simple thing like:
>> 
>> 	ZnClient get: 'http://zn.stfx.eu/zn/small.html'
> 
> It returns:  a ZnResponse(400 Bad Request text/html 3181B)

OK, here is a quick fix/patch:

ZnRequestLine>>writeOn: stream
	| writeStream |
	writeStream := ZnBivalentWriteStream on: stream.
	writeStream nextPutAll: self method; space.
	ZnNetworkingUtils default isProxySet 
		ifTrue: [ self uri printOn: writeStream ]  
		ifFalse: [ self uri printPathQueryFragmentOn: writeStream ].
	writeStream space; nextPutAll: self version; nextPutAll: String crlf 

The problem was that for an HTTP request through a proxy, the url in the request line must be absolute.

Let me know if this works for you.

There is another problem as well: access to, at least localhost, should not go through the proxy.
I am fixing that right now.
I want you to be able to run all Zn unit tests with a proxy set, but half of them are accessing localhost.
Anyway, the full fixes will be committed to the Zn repos first, and will have to be migrated to Pharo next.

Regards,

Sven




More information about the Pharo-project mailing list