The idea is to "hide" redirect responses and return the object from
the new location instead, so assuming http://example.com/1 redirects
to http://example.com/2, which in turn redirects to http://example.com/3,
a request to http://example.com/1 through Fiddler should return the
results of http://example.com/3, not the 301/302 response.
Thanks
--
Klaus Johannes Rusch
Klaus...@atmedia.net
http://www.atmedia.net/KlausRusch/
On Feb 2, 7:56 am, Klaus Johannes Rusch <KlausRu...@atmedia.net>
wrote:
> Is there an easy way to re-issue a request based on the response, and
> return that response to the client (or issue another request if
> needed)?
>
> The idea is to "hide" redirect responses and return the object from
> the new location instead, so assuminghttp://example.com/1redirects
> tohttp://example.com/2, which in turn redirects tohttp://example.com/3,
> a request tohttp://example.com/1through Fiddler should return the
> results ofhttp://example.com/3, not the 301/302 response.
>
> Thanks
>
> --
> Klaus Johannes Rusch
> KlausRu...@atmedia.nethttp://www.atmedia.net/KlausRusch/
On Feb 2, 11:35 pm, EricLaw <bay...@gmail.com> wrote:
> There's no *easy* way to do this. You could write a pretty complicated
> script (or plugin) to do this, but it would be very interesting to
> learn why this would be desirable.
I need to run an application that doesn't handle redirects well, so
trying to pretend the content is available at the URL that actually
sends a 302 response to another URL.
You may be able to piggy-back on the work that I did for the request
builder's "follow redirects" feature in Fiddler 2.2.8.6....
Inside OnBeforeREQUEST, do this:
if (oSession.HostnameIs("whatevertarget.com"))
{
// Instruct Fiddler to itself follow up to two 3xx redirections...
oSession["x-Builder-MaxRedir"] = "2";
}
Note, of course, that when you do this, Fiddler will not pass the
redirect responses to the client. So, if the 3xx response, say, set a
cookie, that cookie will never be seen by the client.
On Feb 2, 2:45 pm, Klaus Johannes Rusch <KlausRu...@atmedia.net>
wrote:
> On Feb 2, 11:35 pm, EricLaw <bay...@gmail.com> wrote:
>
> > There's no *easy* way to do this. You could write a pretty complicated
> > script (or plugin) to do this, but it would be very interesting to
> > learn why this would be desirable.
>
> I need to run an application that doesn't handle redirects well, so
> trying to pretend the content is available at the URL that actually
> sends a 302 response to another URL.
>
> --
> Klaus Johannes Rusch
> KlausRu...@atmedia.nethttp://www.atmedia.net/KlausRusch/
Fantastic, thanks Eric!
I also added the following to onBeforeResponse to pass the actual URL
to the client:
oSession.oResponse["Content-Base"] = oSession.url;
if (oSession.oResponse.headers.ExistsAndContains("Content-Type", "text/
html")) {
oSession.utilDecodeResponse();
var oBody =
System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
if (!oBody.match(/<base/i)) {
oBody = oBody.replace(/<\/head>/gi, "<!-- Inserted by Fiddler
rule --><base href=\"" + encodeURI(oSession.url) + "\"><!-- end --></
head>");
oSession.utilSetResponseBody(oBody);
On Feb 4, 1:03 am, Klaus Johannes Rusch <KlausRu...@atmedia.net>
wrote:
> KlausRu...@atmedia.nethttp://www.atmedia.net/KlausRusch/
// Silently follow redirects
if (m_redirects) {
oSession.oResponse["Content-Base"] = oSession.fullUrl;
if (oSession.oResponse.headers.ExistsAndContains("Content-Type",
"text/html")) {
oSession.utilDecodeResponse();
var oBody =
System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
if (!oBody.match(/<base/i)) {
oBody = oBody.replace(/<\/head>/gi, "<!-- Inserted by Fiddler
rule --><base href=\"" + encodeURI(oSession.fullUrl) + "\"><!-- end --
></head>");