Grieve (grieve) wrote,

Simple solution that does not work

Writing a proxy to store and replay web sites is extremely difficult. I thought I had a simple solution, which was to store the request and its sha-256, then any request which comes in having the same sha-256 will generate the same response. Sounds easy, but in reality the referrer header field in the request can be different every time for the same page. Ok. So we just remove the referrer field (actually, because of an error in the original spec for http, it is the "Referer" field), then create the sha-256, then put the referrer field back and send the request on its way.

Problem Solved!

Not exactly. What if you have a web page you can log into. Now the cookie in the header will be different every time you log in. If you try and do the same trick with the cookie field as you do with the referrer field, you cannot actually log in. I obviously need to think about this some more, and become one with the HTTP 1.1 specification.

Any recommendations are welcome.
Tags: http, programming

  • A C++ quiz

    Suppose I gave you the following snippets of code: #include <cstdio> void Class::PrintFoo() { printf("Foo\n"); } int main() { Class13 c13;…

  • Volatile does not thread safe make.

    I keep running across code, some old and some new, that uses the volatile keyword in an attempt to make the code thread "safe". Using that is always…

  • How many Univacs is that?

    Today at work one of my coworkers had a new phone. I flippantly asked him how many Univacs it was? Of course in a room full of geeks once a question…

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.