Brocade Virtual ADX OpenScript API Guide (Supporting ADX v Manual de usuario Pagina 126

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 132
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 125
114 Brocade Virtual ADX OpenScript API Guide
53-1003243-01
Methods
9
Return values
None
Examples
In the following example, when the response content type is text, the script replaces all of the
"correct" strings with the "valid" string in the response payload.
mstr3 string The string to match. The string can be a fixed length only with a
maximum length of 128 bytes.
rstr3 string The replacement string for the mstr3 matched string. The string can
be a fixed length only with a maximum length of 128 bytes.
TABLE 132 Input values (Continued)
Name Type Description
use OS_HTTP_REQUEST;
use OS_PAYLOAD_INSPECT;
sub HTTP_REQUEST {
if (OS_HTTP_REQUEST::url =~ /login/) {
OS_PAYLOAD_INSPECT::match(
‘gold_member’,
‘basic_member’,
‘visitor’
);
}
}
sub PAYLOAD_INSPECT_MATCHED {
OS_PAYLOAD_INSPECT::matched_replace(
‘login.php’, ‘gold_login.php’,
‘login.php’, ‘basic_login.php’,
‘login.php’, ‘no_login.php’
);
}
use OS_PAYLOAD_INSPECT;
use OS_HTTP_RESPONSE;
sub HTTP_RESPONSE {
my $type = OS_HTTP_RESPONSE::content_type;
if (OS_HTTP_RESPONSE::content_type =~ /text/) {
OS_PAYLOAD_INSPECT::match("correct");
}
}
sub PAYLOAD_INSPECT_MATCHED {
OS_PAYLOAD_INSPECT::matched_replace("","valid");
}
Vista de pagina 125

Comentarios a estos manuales

Sin comentarios