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

[PATCH] split HTTP::Cookies::add_cookie_header into two methods [rt.cpan.org #23980] #17

Open
oalders opened this issue Mar 30, 2017 · 0 comments

Comments

@oalders
Copy link
Member

oalders commented Mar 30, 2017

Migrated from rt.cpan.org#23980 (status was 'new')

Requestors:

Attachments:

From [email protected] on 2006-12-18 17:27:18:

I'm trying to implement cookie testing methods in Test::WWW::Mechanize
and have found myself replicating a bunch of code from
add_cookie_header() in my scan() callback.  I propose that the cookie
matching code be factored out of add_cookie_header() into a separate
method.  The attached patch implements such a refactoring by creating a
new method called cookie_matching() which accepts a $request and returns
an array of cookies.  add_cookie_header() is thus reduced to just the
data munging steps.  I've deliberately left whitespace alone to minimize
the size of the attached patch, but the code should be re-indented if
applied.

I see from
  http://rt.cpan.org/Ticket/Display.html?id=12151
that you prefer not to implement a more detailed cookie inspection API,
and that you believe that web apps should employ functional tests
instead of unit tests with regard to cookies.  So, I understand if you
reject this patch. However, I believe that unit tests on cookies do make
web testing code significantly simpler, and I've made my patch as
unintrusive as possible.

If this patch is acceptable, then I would be willing to document this
new method as well.

Thanks,
  Chris
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant