Ad Widget

Collapse

HTML entities in web scenario

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Einkill
    Junior Member
    • Jun 2017
    • 5

    #1

    HTML entities in web scenario

    Hi!

    I'm testing Zabbix 3.4.0 alpha2 and got stuck on web scenario

    Server is getting variable with HTML entities

    1568:20170801:111914.247 End of http_substitute_variables() data:'<t:RequestSecurityTokenResponse xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust"><t:Lifetime><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    And during post it converts every character as single character but not entity

    1568:20170801:111914.247 process_httptest() use post "wa=wsignin1.0&wresult=%26lt%3Bt%3ARequestSecurity TokenResponse%20xmlns%3At%3D%26quot%3Bhttp%3A%2F%2 Fschemas.xmlsoap.org%2Fws%2F2005%2F02%2Ftrust%26qu ot%3B%3E%26lt%3Bt%3ALifetime%3E%26lt%3Bwsu%3ACreat ed%20xmlns%3Awsu%3D%26quot%3Bhttp%3A%2F%2Fdocs.oas is-open.org%2Fwss%2F2004%2F01%2Foasis-200401-wss-wssecurity-utility-1.0.xsd%26quot
    Is there any way to change the entities in variable for correct symbols before making POST?

    Sorry for my bad English
  • long.chen
    Junior Member
    • Mar 2017
    • 14

    #2
    I also tested zabbix 3.4, the new functions urlecode or urldecode don't work on html entities in http test, I think we need a function to be created such as "htmlentitydecode", common html entities are carriage return and linefeed in http response.

    
 --> %0D
    
 --> %0A

    Comment

    • long.chen
      Junior Member
      • Mar 2017
      • 14

      #3
      I use part of the codes in https://bitbucket.org/cggaertner/cst...ter/entities.c and embedded in Zabbix 3.4 source files "src/libs/zbxhttp/urlencode.c" and "src/zabbix_server/httppoller/httpmacro.c", initial test I have done can decode the html entities in HTTP test variables, hope Zabbix can fix this issue in the future release.

      I put my changes here: https://github.com/omni-lchen/zabbix-patches
      Last edited by long.chen; 06-04-2018, 17:55.

      Comment

      Working...