Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disallowing writes only when fully matched request is in cassette #659

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Sep 27, 2022

  1. disallowing writes only when fully matched request is in cassette

    `cassette.filter_request` only filters some request attributes like
    headers but does not take into account any of the `match_on`
    configurations. As a result if a similar request has been seen before
    but does not fully match as per `match_on`, writes will be disallowed.
    `cassette.__contains__` however fully takes into account all `match_on`
    matchers and therefore will only guard against recording to the cassette
    when the same request has been previously recorded
    miki725 committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    3c3293d View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2022

  1. do not match ignored requests

    assuming:
    
    * any of the ignore requests is configured as documented in
      https://vcrpy.readthedocs.io/en/latest/advanced.html?highlight=ignore_hosts#ignore-requests
    
    * request matchers are configured as documented in
      https://vcrpy.readthedocs.io/en/latest/configuration.html#request-matching
    
    since the filtering logic returns None when request should be ignored
    however matchers assume both requests being compared are valid
    requests and so when one of the requests is None
    it raises AttributeError as no attribute such as "uri"
    can be accessed on NoneType
    
    this fix simply does not consider the request for matching
    if it is ignored
    miki725 committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    62ce106 View commit details
    Browse the repository at this point in the history