warcio.js
warcio.js copied to clipboard
Make POST/non-GET URL canonicalization consistent with pywb
trafficstars
Related to https://github.com/webrecorder/specs/issues/141
warcio.js and pywb have slightly different behavior in terms of how keys are handled.
For example for an input {"a": [[], {}, true, false, null, "", " ", 1, 1.0, -0.0]}, we get the following results in warcio vs pywb:
warcio's jsonToQueryString
2=true&3=false&5=&6=+&7=1&8=1&9=0
pywb
a=True&a.2_=False&a.3_=None&a.4_=&a.5_=+&a.6_=1&a.7_=1.0&a.8_=-0.0
There are two key differences:
- The
akey is getting lost bywarcio.jsdue to our current implementation of a replacer function passed toJSON.stringify. This needs to be addressed to consider full key paths. - pywb is returning Pythonic values, which will be addressed in https://github.com/webrecorder/pywb/issues/859