Homec4science

Expand URI parser test coverage to include SafeCurl test cases

Authored by epriestley <git@epriestley.com> on Mar 25 2015, 18:21.

Description

Expand URI parser test coverage to include SafeCurl test cases

Summary:
Ref T6755. See discussion at https://fin1te.net/articles/safecurl-capture-the-bitcoins-post-mortem/.

We already handle these cases safely, but add test coverage to underscore that.

Basically, in all these cases, we:

  • parse the ambiguous URI with parse_url(), which chooses some interpretation; then
  • emit an unambiguous URI which has only one reasonable interpretation.

So it's OK if we don't choose the same interpretation as cURL on ambiguous URIs, because we only pass unambiguous URIs to cURL.

Test Plan:

  • Added and executed tests.
  • Performed fetches of these sorts of ambiguous URIs from the web UI and observed consistent behavior.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6755

Differential Revision: https://secure.phabricator.com/D12155

Details

Committed
epriestley <git@epriestley.com>Mar 25 2015, 18:21
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUf31dae1d2661: Add an isRedirect() method to HTTPResponseStatus
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU7df0fc1297f9: Expand URI parser test coverage to include SafeCurl test cases (authored by epriestley <git@epriestley.com>).Mar 25 2015, 18:21