ytti / oxidized-web

Web UI + RESTful API for Oxidized
118 stars 72 forks source link

HTML special characters are encoded when request '/node/version/view' #261

Closed max-dw-i closed 2 months ago

max-dw-i commented 3 months ago

When I get a specific config version by requesting /node/version/view?node=NODE&?oid=OID&format=json or /node/version/view?node=NODE&?oid=OID&format=text, HTML special characters are encoded (for example, < is &lt;, " is &quot; and so on). Here is an example:

# # COMMAND: get system status
# Version: FortiGate-40F v1.2.3.4.5
# Firmware Signature: certified
# Virus-DB &lt;db version stripped&gt;
# Extended DB &lt;db version stripped&gt;
...
config system global
    set admintimeout 30
    set alias &quot;FortiGate-40F&quot;
    set hostname &quot;SOME_HOSTNAME&quot;
    ...
end
...

We would like to get a config via REST API and upload it to a device to restore the configuration. Is there any API end-point or, maybe, another format value that would return configs with 'raw' data (without this kind of escaping)? I had a look at issues, README, even the code (though, I am not familiar with ruby that much) and could not find anything.