A batteries included HTTP/1.1 client in OCaml
at claude-test 387 lines 30 kB view raw
1{ 2 "recommendations": [ 3 { 4 "source_repo": "cpp-netlib", 5 "source_language": "C++", 6 "criticality": "medium", 7 "change_type": "feature", 8 "title": "Add DNS resolution caching capability", 9 "description": "cpp-netlib provides a `cache_resolved` option (line 77-83 in client/options.hpp) that caches DNS resolution results to avoid repeated lookups for the same hostname. This reduces latency for repeated requests to the same domain and minimizes DNS query overhead.", 10 "affected_files": [ 11 "lib/requests.ml", 12 "lib/requests.mli", 13 "lib/http_client.ml" 14 ], 15 "rationale": "The OCaml library currently performs DNS resolution on every connection attempt. Adding an optional DNS cache with configurable TTL would improve performance for applications making multiple requests to the same domains, especially in high-throughput scenarios. This is particularly valuable when connection pooling is not used or when pools are exhausted." 16 }, 17 { 18 "source_repo": "cpp-netlib", 19 "source_language": "C++", 20 "criticality": "low", 21 "change_type": "enhancement", 22 "title": "Add automatic EOF retry for stale connections", 23 "description": "cpp-netlib's pooled_connection policy (lines 115-125 in pooled_connection.hpp) implements automatic retry when EOF is encountered on first read, recognizing that pooled connections may have been closed by the server. The connection is re-established and the request retried once automatically.", 24 "affected_files": [ 25 "lib/http_client.ml", 26 "lib/retry.ml" 27 ], 28 "rationale": "The OCaml library's connection pool may encounter stale connections that were closed by the server between requests. While the current retry mechanism handles many error cases, adding specific handling for EOF on first read would improve reliability for long-lived connection pools without requiring full retry configuration. This should be a silent, single automatic retry before falling back to the configured retry policy." 29 }, 30 { 31 "source_repo": "cpp-netlib", 32 "source_language": "C++", 33 "criticality": "medium", 34 "change_type": "feature", 35 "title": "Add configurable OpenSSL/TLS options for advanced TLS configuration", 36 "description": "cpp-netlib exposes `openssl_options` (line 134-137 in options.hpp) allowing users to pass raw OpenSSL flags for fine-grained TLS control (e.g., SSL_OP_NO_SSLv2, SSL_OP_CIPHER_SERVER_PREFERENCE). This enables advanced security hardening and compatibility tuning.", 37 "affected_files": [ 38 "lib/requests.ml", 39 "lib/requests.mli" 40 ], 41 "rationale": "The OCaml library currently uses OCaml-TLS which has different configuration patterns than OpenSSL, but the principle remains valuable. Exposing low-level TLS configuration options (e.g., specific cipher ordering, session resumption control, ALPN protocol selection) would enable security-conscious users to harden their TLS configuration beyond the current `tls_version` setting. This could be achieved by allowing custom `Tls.Config.client` instances to be passed directly." 42 }, 43 { 44 "source_repo": "cpp-netlib", 45 "source_language": "C++", 46 "criticality": "low", 47 "change_type": "feature", 48 "title": "Add streaming response body callback for memory-efficient processing", 49 "description": "cpp-netlib provides a `body_callback_function_type` (lines 37-39 in pooled_connection.hpp) that processes response body chunks as they arrive, avoiding full materialization in memory. This is demonstrated in client_get_streaming_test.cpp (lines 15-24) with a body_handler that appends chunks incrementally.", 50 "affected_files": [ 51 "lib/response.ml", 52 "lib/response.mli", 53 "lib/http_client.ml" 54 ], 55 "rationale": "The OCaml library already supports streaming via `Response.body` returning an `Eio.Flow.source`, which is superior to callbacks in functional programming. However, adding convenience methods like `Response.iter_chunks ~chunk_size ~f:(fun chunk -> ...)` or `Response.fold_chunks` would provide ergonomic alternatives to manual flow reading for common streaming patterns. This enhancement would improve discoverability and reduce boilerplate." 56 }, 57 { 58 "source_repo": "cpp-netlib", 59 "source_language": "C++", 60 "criticality": "high", 61 "change_type": "enhancement", 62 "title": "Add comprehensive timeout testing similar to cpp-netlib test suite", 63 "description": "cpp-netlib includes dedicated timeout tests (client_get_timeout_test.cpp) that verify timeout behavior for both connection and request timeouts, including HTTPS-specific timeout tests. Tests use a local sleep endpoint to reliably trigger timeouts.", 64 "affected_files": [ 65 "test/test_simple.ml", 66 "test/test_localhost.ml" 67 ], 68 "rationale": "The OCaml library has timeout configuration (lib/timeout.ml) but the test suite (test/) appears to lack comprehensive timeout testing. Adding tests that verify connect timeout, read timeout, total timeout, and expect_100_continue timeout behavior would prevent regressions and ensure timeout mechanisms work correctly. This is high criticality because timeout bugs can cause production hangs." 69 }, 70 { 71 "source_repo": "cpp-netlib", 72 "source_language": "C++", 73 "criticality": "medium", 74 "change_type": "enhancement", 75 "title": "Add test coverage for streaming request bodies with generators", 76 "description": "cpp-netlib supports `body_generator_function_type` (line 40 in pooled_connection.hpp) allowing incremental body generation during request transmission. This enables uploading large files or data without loading everything into memory first.", 77 "affected_files": [ 78 "lib/body.ml", 79 "lib/body.mli", 80 "test/test_simple.ml" 81 ], 82 "rationale": "The OCaml library supports streaming request bodies via `Body.of_stream` and `Body.of_file`, but test coverage appears limited (based on test/httpbin.t). Adding tests for large file uploads, chunked encoding, and stream-based bodies would ensure this critical feature works correctly under various conditions. Testing should verify memory efficiency and proper handling of stream errors." 83 }, 84 { 85 "source_repo": "cpp-netlib", 86 "source_language": "C++", 87 "criticality": "low", 88 "change_type": "feature", 89 "title": "Expose configuration for chunk marker removal in chunked encoding", 90 "description": "cpp-netlib provides `remove_chunk_markers` option (lines 161-164 in options.hpp, line 38 in client_get_streaming_test.cpp) allowing users to control whether chunk encoding markers are removed from the body or preserved for manual processing.", 91 "affected_files": [ 92 "lib/http_client.ml", 93 "lib/http_read.ml", 94 "lib/requests.ml" 95 ], 96 "rationale": "The OCaml library likely handles chunked transfer encoding automatically in http_read.ml, but doesn't expose this as a configuration option. While automatic handling is correct for 99% of use cases, advanced users implementing custom HTTP proxies or debugging tools may want access to raw chunked data. Adding an optional `preserve_chunk_markers` flag would enable these specialized use cases without complicating the common path." 97 }, 98 { 99 "source_repo": "cpp-netlib", 100 "source_language": "C++", 101 "criticality": "medium", 102 "change_type": "enhancement", 103 "title": "Add explicit HTTP version negotiation configuration", 104 "description": "cpp-netlib is templated on HTTP version (version_major, version_minor in pooled_connection.hpp line 28) and handles version-specific behavior like connection keep-alive (lines 137-143). Different behavior for HTTP/1.0 vs HTTP/1.1 is explicitly coded.", 105 "affected_files": [ 106 "lib/http_write.ml", 107 "lib/http_client.ml", 108 "lib/requests.ml" 109 ], 110 "rationale": "The OCaml library appears to implement HTTP/1.1 by default but doesn't expose HTTP version as a configuration option. Adding the ability to specify HTTP/1.0 for compatibility with legacy servers, or prepare for HTTP/2 support, would improve flexibility. Configuration should control Connection header behavior (close for HTTP/1.0, keep-alive for HTTP/1.1) and chunk encoding availability." 111 }, 112 { 113 "source_repo": "cpp-netlib", 114 "source_language": "C++", 115 "criticality": "high", 116 "change_type": "bug", 117 "title": "Verify and test redirect location header handling for missing or malformed Location", 118 "description": "cpp-netlib explicitly handles missing Location headers in redirect responses (lines 145-164 in pooled_connection.hpp), throwing a descriptive error 'Location header not defined in redirect response' rather than failing silently or with a cryptic error.", 119 "affected_files": [ 120 "lib/requests.ml", 121 "lib/http_client.ml", 122 "lib/error.ml" 123 ], 124 "rationale": "The OCaml library should verify it properly handles redirect responses (3xx) that are missing Location headers or have malformed Location values. This is a common server misconfiguration that should produce a clear error (Invalid_redirect) rather than causing a URI parsing exception or infinite loop. Review the redirect handling code and add test cases for: missing Location header, empty Location header, and relative vs absolute Location URLs." 125 }, 126 { 127 "source_repo": "cpp-netlib", 128 "source_language": "C++", 129 "criticality": "medium", 130 "change_type": "enhancement", 131 "title": "Add granular error types for redirect failures", 132 "description": "cpp-netlib distinguishes between exceeding maximum redirect count (line 101-102) and missing Location headers (lines 161-163) with different error messages, enabling smarter error handling and debugging.", 133 "affected_files": [ 134 "lib/error.ml", 135 "lib/error.mli" 136 ], 137 "rationale": "The OCaml library already has `Too_many_redirects` and `Invalid_redirect` error types (error.ml lines 21-22), which is good. Ensure that the redirect handling code in requests.ml uses both appropriately: `Too_many_redirects` when count exceeded, `Invalid_redirect` for missing/malformed Location headers. This allows users to distinguish between configuration issues (max_redirects too low) and server errors (bad Location header)." 138 }, 139 { 140 "source_repo": "cpp-netlib", 141 "source_language": "C++", 142 "criticality": "low", 143 "change_type": "enhancement", 144 "title": "Add test infrastructure with local HTTP test server", 145 "description": "cpp-netlib uses a custom `http_test_server` class (client_get_timeout_test.cpp lines 14-30) that provides a local server for reliable, fast testing without external dependencies. Server lifecycle is managed through Google Test's Environment setup/teardown.", 146 "affected_files": [ 147 "test/test_localhost.ml", 148 "test/dune" 149 ], 150 "rationale": "The OCaml test suite uses httpbin.org for integration tests (test/httpbin.t) which requires internet connectivity and is subject to external service availability. While test_localhost.ml exists, expanding it with a more comprehensive local test server (similar to http_test_server) would enable offline testing, faster test execution, and more controlled test scenarios (timeouts, specific error conditions, malformed responses). Consider using a library like cohttp-eio or a minimal TCP server." 151 }, 152 { 153 "source_repo": "cpp-netlib", 154 "source_language": "C++", 155 "criticality": "medium", 156 "change_type": "enhancement", 157 "title": "Add connection socket status checking to avoid sending on closed connections", 158 "description": "cpp-netlib checks `pimpl->is_open()` (line 106 in pooled_connection.hpp) before attempting to send a request, and initializes a new socket if the connection was closed. This prevents errors from attempting to write to closed sockets.", 159 "affected_files": [ 160 "lib/http_client.ml" 161 ], 162 "rationale": "The OCaml library should verify that connection pool connections check socket status before use. While the pool likely handles this, explicitly checking socket state before sending HTTP requests would prevent errors when connections are closed by the server between pool acquisitions. This is especially important for pools with long-lived connections or when servers have aggressive idle timeout policies." 163 }, 164 { 165 "source_repo": "cpp-netlib", 166 "source_language": "C++", 167 "criticality": "low", 168 "change_type": "feature", 169 "title": "Add cipher suite configuration for TLS connections", 170 "description": "cpp-netlib exposes `openssl_ciphers` option (lines 122-125 in options.hpp) allowing users to specify custom cipher suite preferences for TLS negotiation, enabling security hardening by disabling weak ciphers.", 171 "affected_files": [ 172 "lib/requests.ml", 173 "lib/requests.mli" 174 ], 175 "rationale": "The OCaml library uses OCaml-TLS which has its own cipher configuration system. Exposing cipher suite configuration would allow security-conscious applications to restrict to specific cipher suites, disable weak ciphers, or prefer forward secrecy. This could be achieved by accepting a custom `Tls.Config.client` or adding a `ciphers` parameter that constructs appropriate OCaml-TLS configuration. This is lower priority as OCaml-TLS has secure defaults." 176 }, 177 { 178 "source_repo": "cpp-netlib", 179 "source_language": "C++", 180 "criticality": "medium", 181 "change_type": "enhancement", 182 "title": "Add SNI (Server Name Indication) hostname configuration", 183 "description": "cpp-netlib provides `openssl_sni_hostname` option (lines 127-131 in options.hpp) to override the SNI hostname sent during TLS handshake, useful for connecting via IP addresses or when the DNS name differs from the certificate name.", 184 "affected_files": [ 185 "lib/requests.ml" 186 ], 187 "rationale": "The OCaml library should verify that OCaml-TLS correctly extracts and sends SNI hostname from the request URI. For advanced use cases, adding explicit SNI hostname override would enable connecting to servers via IP address while presenting the correct hostname for certificate validation, or implementing virtual hosting scenarios. This is likely already handled correctly by OCaml-TLS, but should be tested and documented." 188 }, 189 { 190 "source_repo": "cpp-netlib", 191 "source_language": "C++", 192 "criticality": "high", 193 "change_type": "enhancement", 194 "title": "Add test coverage for connection close behavior on HTTP/1.0 and Connection: close header", 195 "description": "cpp-netlib explicitly handles connection closure based on HTTP version and Connection header (lines 135-143 in pooled_connection.hpp). HTTP/1.1 connections with 'Connection: close' are closed, and all HTTP/1.0 connections are closed after each request.", 196 "affected_files": [ 197 "lib/http_client.ml", 198 "test/test_simple.ml" 199 ], 200 "rationale": "The OCaml library should have test coverage ensuring proper connection lifecycle management based on HTTP version and Connection header. Tests should verify: HTTP/1.1 with 'Connection: close' closes the connection, HTTP/1.1 without the header keeps it alive for pooling, and proper handling of server-initiated connection closure. This prevents connection pool corruption and resource leaks." 201 }, 202 { 203 "source_repo": "cpp-netlib", 204 "source_language": "C++", 205 "criticality": "medium", 206 "change_type": "enhancement", 207 "title": "Add client certificate authentication support", 208 "description": "cpp-netlib supports client certificate authentication via `openssl_certificate_file` and `openssl_private_key_file` options (lines 107-119 in options.hpp), enabling mutual TLS authentication.", 209 "affected_files": [ 210 "lib/requests.ml", 211 "lib/requests.mli" 212 ], 213 "rationale": "The OCaml library appears to support TLS but may not expose client certificate configuration for mutual TLS (mTLS). Adding support for client certificates would enable authentication with services requiring mTLS, common in microservices, B2B APIs, and high-security environments. This requires accepting client certificate and private key paths, passing them to the OCaml-TLS configuration via `Tls.Config.client ~certificates:... ()`. This is medium priority as mTLS is required for certain enterprise use cases." 214 }, 215 { 216 "source_repo": "cpp-netlib", 217 "source_language": "C++", 218 "criticality": "low", 219 "change_type": "enhancement", 220 "title": "Add custom CA certificate path/directory configuration", 221 "description": "cpp-netlib provides both `openssl_certificate` and `openssl_verify_path` options (lines 96-105 in options.hpp) for specifying custom CA certificates or CA certificate directories for TLS verification.", 222 "affected_files": [ 223 "lib/requests.ml", 224 "lib/requests.mli" 225 ], 226 "rationale": "The OCaml library uses the ca-certs library which loads system CA certificates. Adding the ability to specify custom CA certificate files or directories would support environments with internal CAs, air-gapped systems, or specific compliance requirements. This could be implemented by accepting CA certificate paths and constructing appropriate authenticators for OCaml-TLS. Since ca-certs handles common cases well, this is low priority unless enterprise use cases require it." 227 }, 228 { 229 "source_repo": "cpp-netlib", 230 "source_language": "C++", 231 "criticality": "medium", 232 "change_type": "feature", 233 "title": "Add configurable response body exclusion for certain status codes", 234 "description": "cpp-netlib skips reading response body for specific status codes (lines 129-133 in pooled_connection.hpp): 304 Not Modified, 204 No Content, and 1xx informational responses. This avoids wasting bandwidth and processing time for responses that should not have bodies.", 235 "affected_files": [ 236 "lib/http_read.ml", 237 "lib/http_client.ml" 238 ], 239 "rationale": "The OCaml library should verify it correctly handles responses that must not have bodies according to RFC 9110. Attempting to read bodies from 204, 304, or 1xx responses wastes resources and may cause protocol errors. Review http_read.ml to ensure body reading is skipped for these status codes. Also verify correct handling of HEAD responses (status code check, not method check, is insufficient). Add tests for these edge cases." 240 }, 241 { 242 "source_repo": "cpp-netlib", 243 "source_language": "C++", 244 "criticality": "low", 245 "change_type": "enhancement", 246 "title": "Add typed test infrastructure for testing multiple client configurations", 247 "description": "cpp-netlib uses Google Test's TYPED_TEST_CASE pattern (client_get_timeout_test.cpp line 36) to run the same test suite across multiple client configurations (sync vs async, different tag types), ensuring behavioral consistency.", 248 "affected_files": [ 249 "test/test_simple.ml", 250 "test/dune" 251 ], 252 "rationale": "The OCaml test suite could benefit from parameterized testing across different configurations: with/without connection pooling, different timeout settings, HTTP/1.0 vs HTTP/1.1, different retry configurations. This ensures behavior is consistent across configurations and prevents configuration-specific bugs. OCaml testing frameworks like Alcotest support test generators for this purpose. This would improve test coverage without duplicating test code." 253 }, 254 { 255 "source_repo": "cpp-netlib", 256 "source_language": "C++", 257 "criticality": "high", 258 "change_type": "security", 259 "title": "Verify default TLS peer verification behavior matches cpp-netlib's secure default", 260 "description": "cpp-netlib defaults `always_verify_peer` to true (line 36 in options.hpp), ensuring certificate verification is enabled by default and must be explicitly disabled. This security-by-default approach prevents accidental MITM vulnerabilities.", 261 "affected_files": [ 262 "lib/requests.ml", 263 "lib/requests.mli" 264 ], 265 "rationale": "The OCaml library should verify that TLS certificate verification is enabled by default and requires explicit opt-out via `verify_tls:false`. Review the current default value for the verify_tls parameter and ensure it defaults to true if not specified. This is critical for security - users who don't explicitly configure TLS should get secure defaults. Add documentation warning about the security implications of disabling verification." 266 }, 267 { 268 "source_repo": "cpp-netlib", 269 "source_language": "C++", 270 "criticality": "low", 271 "change_type": "feature", 272 "title": "Add shared I/O service configuration for resource pooling", 273 "description": "cpp-netlib allows passing a shared `boost::asio::io_service` (lines 139-143 in options.hpp) enabling multiple clients to share the same event loop and thread pool, improving resource efficiency in applications with many client instances.", 274 "affected_files": [ 275 "lib/requests.ml" 276 ], 277 "rationale": "The OCaml library uses Eio which has a different concurrency model than ASIO. However, the concept of sharing resources across multiple request instances is valuable. The library already supports this through shared connection pools via the `http_pool` and `https_pool` parameters in `Requests.create`. Ensure this is well-documented with examples showing how to share pools across multiple request instances for maximum efficiency." 278 }, 279 { 280 "source_repo": "cpp-netlib", 281 "source_language": "C++", 282 "criticality": "medium", 283 "change_type": "enhancement", 284 "title": "Add Base64 encoding utilities for authentication header generation", 285 "description": "cpp-netlib includes base64 encoding utilities (utils/base64/encode.hpp, tested in utils_base64_test.cpp) specifically for authentication, as Basic auth requires Base64 encoding of credentials.", 286 "affected_files": [ 287 "lib/auth.ml", 288 "lib/headers.ml" 289 ], 290 "rationale": "The OCaml library likely already uses the base64 library for Basic authentication (referenced in dune dependencies). Verify that the Base64 encoding for Basic auth headers is correct and includes the 'Basic ' prefix. Add test coverage specifically for authentication header generation with various special characters in username/password (colons, Unicode, etc.) to ensure correct encoding. This is medium priority as authentication is security-critical." 291 }, 292 { 293 "source_repo": "cpp-netlib", 294 "source_language": "C++", 295 "criticality": "medium", 296 "change_type": "feature", 297 "title": "Add request and response parser incremental testing", 298 "description": "cpp-netlib includes comprehensive tests for incremental parsing (request_incremental_parser_test.cpp, response_incremental_parser_test.cpp) ensuring the parser correctly handles partial reads, chunked delivery, and edge cases.", 299 "affected_files": [ 300 "lib/http_read.ml", 301 "lib/http_write.ml", 302 "test/" 303 ], 304 "rationale": "The OCaml library uses Eio's Buf_read and Buf_write for parsing, which likely handles incremental reads correctly. However, adding explicit tests for parsing under adverse conditions (single-byte reads, split headers, partial chunk markers, interrupted streams) would ensure robustness. These tests prevent bugs when network conditions cause fragmented HTTP messages. Create unit tests that feed HTTP responses/requests byte-by-byte to the parser." 305 }, 306 { 307 "source_repo": "cpp-netlib", 308 "source_language": "C++", 309 "criticality": "low", 310 "change_type": "feature", 311 "title": "Add request and response message linearization for debugging", 312 "description": "cpp-netlib includes tests for message linearization (request_linearize_test.cpp) - serializing the request/response object back to wire format for debugging, logging, or proxying.", 313 "affected_files": [ 314 "lib/http_write.ml", 315 "lib/http_read.ml", 316 "lib/requests.ml" 317 ], 318 "rationale": "The OCaml library has http_write.ml for request serialization but may not expose this as a debugging utility. Adding a function like `Request.to_string` or `Response.to_string` that produces the wire format would be valuable for debugging, logging (at debug level), and implementing HTTP proxies. This should be opt-in and respect the logging configuration to avoid exposing sensitive data by default. Low priority but useful for troubleshooting." 319 }, 320 { 321 "source_repo": "cpp-netlib", 322 "source_language": "C++", 323 "criticality": "medium", 324 "change_type": "enhancement", 325 "title": "Add comprehensive response header parser testing with edge cases", 326 "description": "cpp-netlib includes server_header_parser_test.cpp and response_incremental_parser_test.cpp with extensive edge case testing for header parsing: continuation lines, whitespace handling, case sensitivity, duplicate headers, etc.", 327 "affected_files": [ 328 "lib/http_read.ml", 329 "test/" 330 ], 331 "rationale": "HTTP header parsing is security-sensitive and must handle malformed input gracefully. The OCaml library should have comprehensive tests for header parsing edge cases: headers with no values, headers with trailing whitespace, duplicate header names (should combine or take last?), extremely long headers (should respect limits), headers with special characters, and case sensitivity. These tests prevent request smuggling and other HTTP parsing vulnerabilities." 332 }, 333 { 334 "source_repo": "cpp-netlib", 335 "source_language": "C++", 336 "criticality": "medium", 337 "change_type": "enhancement", 338 "title": "Add SSL/HTTPS-specific test infrastructure and coverage", 339 "description": "cpp-netlib conditionally compiles HTTPS tests (client_localhost_ssl_test.cpp, lines 61-74 in client_get_timeout_test.cpp) when BOOST_NETWORK_ENABLE_HTTPS is defined, ensuring TLS-specific functionality is tested separately.", 340 "affected_files": [ 341 "test/test_localhost.ml", 342 "test/dune" 343 ], 344 "rationale": "The OCaml library should have dedicated HTTPS test coverage including: certificate validation, TLS handshake failures, certificate chain verification, hostname verification, expired certificates, self-signed certificate handling, and TLS timeout scenarios. These tests should use a local test server with generated certificates. This ensures TLS implementation is secure and handles error cases correctly. Create a test fixture that sets up local HTTPS server with various certificate configurations." 345 }, 346 { 347 "source_repo": "cpp-netlib", 348 "source_language": "C++", 349 "criticality": "low", 350 "change_type": "enhancement", 351 "title": "Add async/promise-based request testing patterns", 352 "description": "cpp-netlib tests both synchronous and asynchronous client implementations, with async tests verifying that response futures resolve correctly (message_async_ready_test.cpp, client_get_ready_test.cpp).", 353 "affected_files": [ 354 "test/test_simple.ml", 355 "test/test_one.ml" 356 ], 357 "rationale": "The OCaml library uses Eio fibers for concurrency, which is different from C++ futures but serves the same purpose. Test coverage should verify concurrent request patterns work correctly: multiple concurrent requests via Fiber.both/all, promise-based communication between fibers, cancellation behavior, and timeout propagation in concurrent scenarios. This ensures the library's concurrency model is sound and free of race conditions." 358 }, 359 { 360 "source_repo": "cpp-netlib", 361 "source_language": "C++", 362 "criticality": "medium", 363 "change_type": "enhancement", 364 "title": "Add test coverage for different port numbers and non-standard ports", 365 "description": "cpp-netlib includes client_get_different_port_test.cpp specifically testing requests to non-standard HTTP ports (8000, 8080, etc.), ensuring port handling in URLs and Host headers is correct.", 366 "affected_files": [ 367 "test/test_simple.ml", 368 "test/httpbin.t" 369 ], 370 "rationale": "The OCaml library should have explicit test coverage for non-standard ports: port in URL vs default ports (80 for HTTP, 443 for HTTPS), Host header generation with port numbers, connection pooling with same host but different ports, and URL parsing edge cases (missing port, port 0, port > 65535). This ensures URL and connection handling is robust across different deployment scenarios." 371 }, 372 { 373 "source_repo": "cpp-netlib", 374 "source_language": "C++", 375 "criticality": "low", 376 "change_type": "feature", 377 "title": "Add convenience constructors for common client configurations", 378 "description": "cpp-netlib includes client_constructor_test.cpp and server_constructor_test.cpp testing various constructor patterns and configuration combinations, emphasizing API ergonomics.", 379 "affected_files": [ 380 "lib/requests.ml", 381 "lib/requests.mli", 382 "lib/one.ml" 383 ], 384 "rationale": "The OCaml library has `Requests.create` and `One.create` but could benefit from convenience constructors for common patterns: `create_with_retry`, `create_with_auth`, `create_for_json_api` (with JSON content-type defaults), etc. These would reduce boilerplate for common use cases while maintaining the flexible base API. Alternatively, consider a builder pattern via `Requests.create |> with_auth ... |> with_retry ...`. Low priority as current API is already clean." 385 } 386 ] 387}