ooni-probe-cli/internal/netxlite
Simone Basso 6a935d5407
fix(netxlite): ensure HTTP errors are always wrapped (#584)
1. introduce implementations of HTTPTransport and HTTPClient
that apply an error wrapping policy using the constructor
for a generic top-level error wrapper

2. make sure we use the implementations in point 1 when we
are constructing HTTPTransport and HTTPClient

3. make sure we apply error wrapping using the constructor for
a generic top-level error wrapper when reading bodies

4. acknowledge that error wrapping would be broken if we do
not return the same classification _and_ operation when we wrap
an already wrapped error, so fix the to code to do that

5. acknowledge that the classifiers already deal with preserving
the error string and explain why this is a quirk and why we
cannot remove it right now and what needs to happen to safely
remove this quirk from the codebase

Closes https://github.com/ooni/probe/issues/1860
2021-11-06 17:49:58 +01:00
..
dnsx doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
filtering Revert "feat(filtering): implement the divert policy (#569)" (#570) 2021-11-03 14:01:32 +01:00
internal doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
mocks fix(filtering): avoid the if err == nil pattern (#567) 2021-11-02 19:48:10 +01:00
quicx doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
bogon_test.go cleanup: move bogon checking code in netxlite (#562) 2021-11-02 12:20:04 +01:00
bogon.go cleanup: move bogon checking code in netxlite (#562) 2021-11-02 12:20:04 +01:00
certifi_test.go netxlite: improve docs, tests, and code quality (#493) 2021-09-08 21:19:51 +02:00
certifi.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
classify_test.go refactor: merge dnsx and errorsx into netxlite (#517) 2021-09-28 12:42:01 +02:00
classify.go fix(netxlite): ensure HTTP errors are always wrapped (#584) 2021-11-06 17:49:58 +01:00
dialer_test.go feat(netxlite): implement hooks for transparent proxy (#561) 2021-11-02 12:04:40 +01:00
dialer.go feat(netxlite): implement hooks for transparent proxy (#561) 2021-11-02 12:04:40 +01:00
dnsdecoder_test.go refactor: merge dnsx and errorsx into netxlite (#517) 2021-09-28 12:42:01 +02:00
dnsdecoder.go doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
dnsencoder_test.go refactor: merge dnsx and errorsx into netxlite (#517) 2021-09-28 12:42:01 +02:00
dnsencoder.go doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
dnsoverhttps_test.go refactor: merge dnsx and errorsx into netxlite (#517) 2021-09-28 12:42:01 +02:00
dnsoverhttps.go fix(netxlite): ensure HTTP errors are always wrapped (#584) 2021-11-06 17:49:58 +01:00
dnsovertcp_test.go refactor: merge dnsx and errorsx into netxlite (#517) 2021-09-28 12:42:01 +02:00
dnsovertcp.go doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
dnsoverudp_test.go refactor: merge dnsx and errorsx into netxlite (#517) 2021-09-28 12:42:01 +02:00
dnsoverudp.go doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
dnstransport.go doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
doc.go doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
errno_android_test.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno_android.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno_darwin_test.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno_darwin.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno_freebsd_test.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno_freebsd.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno_ios_test.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno_ios.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno_linux_test.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno_linux.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno_windows_test.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno_windows.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errno.go master: update deps and set version to 3.12.0-alpha (#548) 2021-10-20 18:16:40 +02:00
errwrapper_test.go fix(netxlite): ensure HTTP errors are always wrapped (#584) 2021-11-06 17:49:58 +01:00
errwrapper.go fix(netxlite): ensure HTTP errors are always wrapped (#584) 2021-11-06 17:49:58 +01:00
http_test.go fix(netxlite): ensure HTTP errors are always wrapped (#584) 2021-11-06 17:49:58 +01:00
http.go fix(netxlite): ensure HTTP errors are always wrapped (#584) 2021-11-06 17:49:58 +01:00
http3_test.go netxlite: code quality, improve tests, docs (#494) 2021-09-08 22:48:10 +02:00
http3.go fix(netxlite): http3 transport needs logging by default (#492) 2021-09-08 20:49:01 +02:00
integration_test.go fix(netxlite): make test less flaky on macOS (#526) 2021-09-30 00:25:05 +02:00
iox_test.go fix(netxlite): ensure HTTP errors are always wrapped (#584) 2021-11-06 17:49:58 +01:00
iox.go fix(netxlite): ensure HTTP errors are always wrapped (#584) 2021-11-06 17:49:58 +01:00
legacy_test.go feat(netxlite): implement LookupHTTPS (#514) 2021-09-27 23:09:41 +02:00
legacy.go doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
logger.go refactor: move httptransport w/ logging to netxlite (#411) 2021-06-26 18:11:47 +02:00
operations.go doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
quic_test.go doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
quic.go feat(netxlite): implement hooks for transparent proxy (#561) 2021-11-02 12:04:40 +01:00
quirks_test.go refactor: merge dnsx and errorsx into netxlite (#517) 2021-09-28 12:42:01 +02:00
quirks.go refactor: merge dnsx and errorsx into netxlite (#517) 2021-09-28 12:42:01 +02:00
resolver_test.go fix(resolver_test.go): remove race and make deterministic (#524) 2021-09-29 20:33:39 +02:00
resolver.go feat(netxlite): implement hooks for transparent proxy (#561) 2021-11-02 12:04:40 +01:00
serialresolver_test.go feat: run ~always netxlite integration tests (#522) 2021-09-29 16:04:26 +02:00
serialresolver.go fix(wcth): match legacy TH w/ empty DNS reply (#546) 2021-10-15 16:20:07 +02:00
tls_test.go refactor: merge dnsx and errorsx into netxlite (#517) 2021-09-28 12:42:01 +02:00
tls.go doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
tproxy.go feat(netxlite): implement hooks for transparent proxy (#561) 2021-11-02 12:04:40 +01:00
utls_test.go refactor(netxlite): finish grouping tests (#488) 2021-09-08 11:39:27 +02:00
utls.go doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00