This is what I have now, the objectives have changed slightly, but I have an issue:
when HTTP_REQUEST {
if {([HTTP::path] starts_with "/mmsc/mm7") and ([HTTP::method] eq
"POST")}{
read out boundry
set tblength [string first "Content-Type" [HTTP::payload]]
set blength [expr {$tblength - 4}]
set bdary [substr [HTTP::payload] 2 $blength]
Insert Missing HTTP tag.
set olddata [HTTP::header value "Content-Type"]
set missing "start=\"\";"
HTTP::header replace "Content-Type" "$olddata
boundary=\"$bdary\"; $missing"
Add missing pdu content
insert Content-ID
set tmp [string first "Content-Type" [HTTP::payload] ]
set bypass [expr {$tmp + 37}]
HTTP::payload replace $bypass 0 "\r\nContent-ID:
"
insert CID:
set bypass2 [string first "comverse.cid" [HTTP::payload] ]
HTTP::payload replace $bypass2 0 "cid:"
fix boundry in payload
set tbypass3 [string first ".boundary=" [HTTP::payload] ]
log local0. "$tbypass3"
set bypass3 [expr {$tbypass3 - 2}]
if {$bypass3 > 0}{
HTTP::payload replace $bypass3 3 " "
}
}
}
The fix boundry in payload section never finds the actual string .boundry, is there some limitations on how much HTTP::payload can read? if not what do you think is wrong with this?
Tim