Salamek/huawei-lte-api-ts

Diagnosis: traceroute - incomplete result bad json

diabolusss opened this issue · 1 comments

I have changed url for traceroute request to diagnosis/diagnose_traceroute, because traceroute function with ping doesnt work (for huawei b535).
And in traceroute i see such result:

{
  DiagnosticsState: 'Complete',
  ResponseTime: '0',
  RouteHops: {
    RouteHop: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object]
    ]
  },
  RouteHopsNumberOfEntries: '10',
  Host: 'google.com',
  Result: '0'
}

raw xml:

"<?xml version=\"1.0\" encoding=\"UTF-8\"?><response><DiagnosticsState>Complete</DiagnosticsState><ResponseTime>0</ResponseTime><RouteHops><RouteHop><HopErrorCode>3</HopErrorCode><ID>1</ID><HopHostAddress>10.193.72.41</HopHostAddress><HopHost>10.193.72.41</HopHost><HopRTTimes>15,12,14</HopRTTimes></RouteHop><RouteHop><HopErrorCode>0</HopErrorCode><ID>2</ID><HopHostAddress>10.241.166.117</HopHostAddress><HopHost>10.241.166.117</HopHost><HopRTTimes>15,12,14</HopRTTimes></RouteHop><RouteHop><HopErrorCode>0</HopErrorCode><ID>3</ID><HopHostAddress>10.241.166.118</HopHostAddress><HopHost>10.241.166.118</HopHost><HopRTTimes>13,13,14</HopRTTimes></RouteHop><RouteHop><HopErrorCode>0</HopErrorCode><ID>4</ID><HopHostAddress>10.241.166.122</HopHostAddress><HopHost>10.241.166.122</HopHost><HopRTTimes>19,13,14</HopRTTimes></RouteHop><RouteHop><HopErrorCode>0</HopErrorCode><ID>5</ID><HopHostAddress>84.15.16.29</HopHostAddress><HopHost>84.15.16.29</HopHost><HopRTTimes>30,29,14</HopRTTimes></RouteHop><RouteHop><HopErrorCode>0</HopErrorCode><ID>6</ID><HopHostAddress>213.252.226.198</HopHostAddress><HopHost>213.252.226.198</HopHost><HopRTTimes>34,34,23</HopRTTimes></RouteHop><RouteHop><HopErrorCode>0</HopErrorCode><ID>7</ID><HopHostAddress>209.85.148.208</HopHostAddress><HopHost>209.85.148.208</HopHost><HopRTTimes>30,25,27</HopRTTimes></RouteHop><RouteHop><HopErrorCode>0</HopErrorCode><ID>8</ID><HopHostAddress>209.85.253.253</HopHostAddress><HopHost>209.85.253.253</HopHost><HopRTTimes>29,28,27</HopRTTimes></RouteHop><RouteHop><HopErrorCode>0</HopErrorCode><ID>9</ID><HopHostAddress>209.85.246.27</HopHostAddress><HopHost>209.85.246.27</HopHost><HopRTTimes>30,28,34</HopRTTimes></RouteHop><RouteHop><HopErrorCode>3</HopErrorCode><ID>10</ID><HopHostAddress>216.58.207.206</HopHostAddress><HopHost>216.58.207.206</HopHost><HopRTTimes>23,26,38</HopRTTimes></RouteHop></RouteHops><RouteHopsNumberOfEntries>10</RouteHopsNumberOfEntries><Host>google.com</Host><Result>0</Result></response>"

As hidden data is accessible i assume it's a problem of console.log and express parsing. JSON.stringify gives a correct result.