Skip to content

0.15

Latest

Choose a tag to compare

@shpaker shpaker released this 17 Oct 13:32
· 2 commits to main since this release

Secret masking, pytest and Robot Framework integrations, documentation, and a round of fixes for commands that sent something other than the request.

Behavior change: with shell="powershell", a value holding a line break (a pretty-printed JSON body, a multi-line field) now raises ValueError instead of returning a command that would run the next line as PowerShell. Render such requests with shell="sh".

Documentation: https://shpaker.github.io/curlify3/

Added

  • mask_headers on to_curl() / to_curl_async(), plus a SENSITIVE_HEADERS constant: the named headers stay in the command with *** for their values. Auth headers keep the scheme (Bearer ***), cookies keep their names (#35).
  • A pytest plugin, curlify3.pytest_plugin: a failing test's report gets the curl commands of the requests the test sent. Turn it on with --curl-on-failure, curl_on_failure = true or the curl_requests fixture (#44).
  • A Robot Framework library, curlify3.robot (pip install curlify3[robot]): To Curl, Log As Curl, and Enable / Disable Curl Logging for RequestsLibrary sessions.
  • A documentation site with logging recipes for every supported framework and client. The README is now a short introduction.

Changed

  • An unsupported request object raises UnsupportedRequestError, a subclass of both TypeError and ValueError. The message names the type, and says when the other entrypoint accepts it (#33).
  • The PyPI description, keywords and project links (#34).

Fixed

  • Shell and file-read vectors (#45): multipart values -F would parse go through --form-string, filenames with ; or , are quoted, and a cookie without = no longer makes -b read a cookie file.
  • Urls and headers as the request carried them (#48): the raw, still-encoded path for starlette, werkzeug and django, -g for urls with []{}, repeated headers kept, and empty header values sent.
  • Multipart bodies as they were sent (#50): one boundary, empty file inputs, and multipart/related / multipart/mixed sent unchanged.
  • What each library actually sends (#52): -X GET for a GET with a body, -I for HEAD, a werkzeug form parsed before rendering, urllib's and tornado's default content-type, tornado client auth / user-agent headers, and django DisallowedHost.

The full list is in the changelog.