Re: Adding static HTML code

From: Dancer <dancer@dont-contact.us>
Date: Mon, 29 Mar 1999 12:42:03 +1000

d baud wrote:
>
> I am trying to set up an intranet service where all employees browse our
> web servers through Squid. I need to spawn a pop-up window with a
> navigation menu on each page. I know that it would be more logical to
> add this HTML code on the web servers directly but I don't have write
> access to all HTML on those servers.
>
> To make things simple, I could live with the following limitations:
> - The HTML code could be added before or after the <HTML /HTML>
> boundaries of the served page since it would be in Javascript
> - The HTML code added would be static
> - The HTML code is sent to all served pages, it is simply an addition of
> text
>
> I started looking around in the Squid's source code but I can't seem to
> find the ideal place to add a simple text stream before HTML is sent to
> the user's browser.
> If anyone cares to give me a hint on where to add this text string, it
> would surely save me hours of search.
>
> D Baud

Been there. Done it. Got the tee-shirt. Deja-vu just isn't what it used
to be.

I've got to preserve confidentiality on all the details, but if you look
at client_side.c where the headers are being added just before the body
is to be sent, you can append a fake http header with an embedded CRLF
followed by some HTML.

-> Beware <- This really speaking violates all sorts of HTTP standards,
and depending on what you do, a lot of HTML ones as well. The _apparent_
body of the object the user receives is larger than the advertised
content-length (though you can change that header too, to accomodate
your extra code).

You WILL encounter Evil Issues(tm) with this. I did. I encountered HUGE
problems with browser behaviour, and ended up requiring the use of
javascript, and having to write a content-scanning proxy (because of
issues with pages in framesets and pages including layers).

Think VERY VERY VERY hard about this before trying it at home. I burned
a hell of a lot of time addressing all the issues, and I _still_ think
that I haven't got them all.

If there is another way for you to do this, I wholeheartedly recommend
that you do it, rather than attempt this feat the way I have described
it.

D
Disclaimer: Yes, it violates an amazing amount of stuff. I just write
the code, not the policies.
Received on Sun Mar 28 1999 - 19:29:41 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:45:27 MST