As of Perl 5.18 the “random ordering” of Perl hashes are no longer repeatable. This has resulted in many previously “unordered” structures (such as XML attributes and JSON objects) being returned in randomized orders on each execution instead of the same repeatable order.
SRS Protocol
As a result of fully randomized hashing inside Perl, XML attributes are now returned in a random order:
SRS 6.x behaviour:
<NZSRSResponse VerMajor="7" RegistrarId="945" VerMinor="0">
SRS 7.x behaviour examples:
<NZSRSResponse VerMinor="0" VerMajor="7" RegistrarId="945">
<NZSRSResponse VerMajor="7" RegistrarId="945" VerMinor="0">
<NZSRSResponse VerMinor="0" RegistrarId="945" VerMajor="7">
The XML specification states that the order of attributes within a tag are not significant, so this is not likely to cause issues with XML parsing libraries. As such, the main risk is for simplistic systems which have implemented regex (or similar) pattern matching on XML attributes.
Please note that as part of SRS Release 5.40 in February 2014 we switched from ordered attributes to the current state of unordered but repeatable attributes as we no longer needed this under the new database architecture. If you encountered problems at that time you may wish to carefully validate your systems against release 7.x in the SRS Test environment.
EPP Server
Ordering of ObjURI elements now varies, for example:
SRS 6.x behaviour:
<objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
<objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
SRS 7.x behaviour examples:
<objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
<objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
Rest API
Each JSON object attribute is now returned in a random order as per the following examples:
SRS 7.x behaviour examples:
[
{
"code": "200",
"status": "Active",
"domain": "internetnz.net.nz"
}
]
[
{
"status": "Active",
"code": "200",
"domain": "internetnz.net.nz"
}
]
[
{
"code": "200",
"domain": "internetnz.net.nz",
"status": "Active"
}
]
As per RFC 4627 a JSON object is defined as ‘an unordered collection of zero or more name/value pairs’ and as such this should not cause any issues for standard JSON parsers.