Updated to support more server with different query-string parsing behavior.