Re: [Http-webtest-general] how to set Referer html field while POSTing
Brought to you by:
m_ilya,
richardanderson
From: Srdjan <sr...@ca...> - 2004-04-27 07:04:13
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This is how: I changed existing if(defined $click_link) {} elsif(defined $click_button) {} elsif(defined $form_name) {} switch, but you may not need all the changes, just the marked one lib/HTTP/WebTest/Plugin/Click.pm, around line 102: - ----- cut here --------- ~ if(defined $click_link) { # find matching link my $link = $self->find_link(response => $response, pattern => $click_link); if (defined $link) { $request->uri($link) ~ $request->referer($response->base); # <--- this is what you need ~ } ~ } elsif($click_button || $form_name) { # find action which corresponds to requested submit button and/or form name # we combine it because we may have a situation with multiple forms on the page my $action = $self->find_form(response => $response, form_name => $form_name, pattern => $click_button); $request->uri($action) if defined $action; ~ } - ----- cut here --------- I was supposed to check this in ages ago, but I got tied up and couldn't get around testing all changes properly. And the way things are going, I'll be dead for another two months, so you'll have to hack it for the time being. Cheers, Srdjan Raghavendra Hegde wrote: | Hi, | | My web-server expects the "Referer" HTTP header field to be set with | some values. | Can anybody let me know, how to set this field using HTTP::WebTest. | | I am trying to upload a file, but the webserver takes the PATH to store | the uploaded file, | from the Referer field (such as listedpath=/home/raghavendra/Docs) ;; | I dont know how to set this field from Webtest. | | Thanks, | Raghavendra | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Debian - http://enigmail.mozdev.org iD4DBQFAjgWkX4ZD19jq88YRAmvRAJiZs+5PodiUnqpTgo+4mw1qfEEnAJoDdmu+ PtXpa53MJPC6Ym9FTkGAvA== =wWQQ -----END PGP SIGNATURE----- |