when HTTP_REQUEST {
#log "URL : [HTTP::host]"
#log "URI : [HTTP::path]"
set URIclient [getfield [HTTP::uri] "/" 2]
log "URIclient = $URIclient"
set URIpath [getfield [HTTP::uri] "/" 3]
#log "URIpath = $URIpath"
set URIpathdef [string map -nocase [list /$URIclient ""] [HTTP::uri]]
log "URIpathdef = $URIpathdef"
if { [SSL::verify_result] == 0 }{
#log "Certificat OK"
HTTP::header insert "SSL_CLIENT_CERT" [X509::whole [SSL::cert 0]]
HTTP::header replace Host "thing.$URIclient"
HTTP::uri $URIpathdef
#log "Acces = [HTTP::host][HTTP::uri]"
}
}
when HTTP_REQUEST_SEND {
}
when HTTP_RESPONSE {
log "STATUS : [HTTP::status]"
log "LOCATION : [HTTP::header value "Location"]"
}