GO 46 !


RD Dreams

MacDizzy

DBS

YADBS

SourceForge

SIX

Rally.co.in

Rossi Files

Open Solaris

Meebo

Crash.net

MotoGP

Beginning of End

Elving's blog

Sandeep's page

Sun Forums

Air Cooled RD

MindStorms

LEGO-Robotics

Track Guide

Track Forum

M's blogs

BikesZone

Kawasaki Triples

PhRack

Metallica

Distance Running

RD Shop

SMX - Solaris Minix

Elephant Story

WD40

Dan's M/C Site

Tunnel Rats

Gatorade

Orkut

Free Science

Spiderman McBride

Racing a Fiat

Forsyth

BSM Archives

Bugatti Veyron

RNR Racing

Modifying client headers

In the nsapi scripting plugin, earlier, i had added a setheader command through which a header:value can be inserted into the incoming client headers. But i found that rather clumsy - why should the script writer come to realize that rq.headers are somehow special, and that, to insert something into them, one should call setheaders - while rq.reqpb, rq.srvhdrs, can be modified like just any other variable.

So i added a bit of code to get around this, and now rq.headers.xxx can be treated just like the rest.

For example, say you want to configure your proxy server such that it "ignores" "pragma: no-cache":

# Get rid of "pragma: no-cache"

p = $rq.headers.pragma
if $p == ".*no-cache.*"
then
        rq.headers.pragma = ""
fi

I have also enabled "script caching" now. If you don't want caching - say if you wanna modify a script on the fly - then just add a caching="off" argument while invoking the nsh SAF. With caching, there is a heavy performance boost, as the disk read & lexer/parser stages need to happen only once.

Comments [0]




Trackback URL: http://blogs.sun.com/motor/entry/modifying_client_headers
Comments:

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed