<urlcp header >

Post Reply
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

<urlcp header >

Post 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"
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

<urlcp header >

Post 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.
John Turnbull
Thunderstone Software
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

<urlcp header >

Post by bart »

Ya I knew that from reading the manual, but the behavior was slightly unexpected.
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

<urlcp header >

Post by Kai »

This has been changed for the next update: <urlcp header> values now override values set automatically or by other <urlcp> functions.
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

<urlcp header >

Post by bart »

excellent
Post Reply