[Box-Admins] Re: wiki.squeak.org
Jochen F. Rick
nadja at cc.gatech.edu
Wed May 23 18:36:30 UTC 2007
Hi Ken,
I've got another version of the ProxyForwarding that might fix some of
the problems you have been experiencing. I'm attaching it.
Peace and Luck!
Jeff
--
Jochen "Jeff" Rick, Ph.D., Georgia Tech College of Computing
jochen.rick at cc.gatech.edu, http://www.je77.com/, work: 404-385-1105
-------------- next part --------------
'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 23 May 2007 at 1:57:15 pm'!
!HttpRequest methodsFor: 'initialize-release' stamp: 'je77 5/23/2007 13:56'!
initProxyForwarding
"If a proxy exists on the host, change the remoteAddress to ignore the proxy."
| forwardingAddress |
self remoteAddress = stream socket localAddress
ifTrue: ["A proxy probably exists, because the request is from the local machine."
forwardingAddress := self headerAt: 'x-forwarded-for' ifAbsent: [^self].
"Convert forwardingAddress string to ByteArray"
(forwardingAddress includes: $,) ifTrue: [
"Use only the last entry as this is the only trustable one"
forwardingAddress := forwardingAddress copyAfterLast: $,].
forwardingAddress := forwardingAddress asIpByteArray.
self remoteAddress: forwardingAddress]! !
More information about the Box-Admins
mailing list