Page 1 of 1

<urlcp header >

Posted: Sun Feb 22, 2009 11:22 am
by bart
Setting headers is not clearing pre-existing headers of the same name. This causes duplicates.
Commercial Version 5.01.1109947850 20050304 (i686-unknown-linux2.4.9-64-32)



I ran this code to simulate a cell phone browser:
<$vars=
ACCEPT
ACCEPT_ENCODING
ACCEPT_LANGUAGE
CONNECTION
HOST
REFERER
UA_COLOR
UA_CPU
UA_OS
UA_PIXELS
UA_VOICE
USER_AGENT
X_WAP_PROFILE
>
<$vals=
'*/*'
'gzip,deflate'
'en-us'
'Keep-Alive'
'm.google.com'
'http://m.google.com/'
'color16'
'x86'
'Windows CE (Smartphone) - Version 5.1'
'320x240'
'TRUE'
'Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; Smartphone; 176x220)'
'"http://uaprof.vtext.com/mot/q2/q2v1.xml"'
>
<urlcp header $vars $vals>


The server saw this from the <fetch>

HTTP_ACCEPT ENV */*
HTTP_ACCEPT ENV */*
HTTP_ACCEPT_ENCODING ENV gzip,deflate
HTTP_ACCEPT_LANGUAGE ENV en-us
HTTP_CONNECTION ENV Keep-Alive
HTTP_CONNECTION ENV Keep-Alive
HTTP_HOST ENV 206.183.1.150
HTTP_HOST ENV m.google.com
HTTP_REFERER ENV http://m.google.com/
HTTP_UA_COLOR ENV color16
HTTP_UA_CPU ENV x86
HTTP_UA_OS ENV Windows CE (Smartphone) - Version 5.1
HTTP_UA_PIXELS ENV 320x240
HTTP_UA_VOICE ENV TRUE
HTTP_USER_AGENT ENV Mozilla/2.0 (compatible; T-H-U-N-D-E-R-S-T-O-N-E)
HTTP_USER_AGENT ENV Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; Smartphone; 176x220)
HTTP_X_WAP_PROFILE ENV "http://uaprof.vtext.com/mot/q2/q2v1.xml"

<urlcp header >

Posted: Mon Feb 23, 2009 9:53 am
by John
Headers set automatically or by other functions are not replaced by <urlcp header>. You can use <urlcp accept> to set the accept header, <urlcp maxkeepaliverequests> to get the proper behavior with Connection, <urlcp useragent> to set the user agent, and the Host: header is set automatically from the URL being fetched.

<urlcp header >

Posted: Mon Feb 23, 2009 11:54 am
by bart
Ya I knew that from reading the manual, but the behavior was slightly unexpected.

<urlcp header >

Posted: Fri Jun 26, 2009 11:25 am
by Kai
This has been changed for the next update: <urlcp header> values now override values set automatically or by other <urlcp> functions.

<urlcp header >

Posted: Fri Jun 26, 2009 1:57 pm
by bart
excellent