http headers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • alexk

    http headers

    [x-posted here and there]

    Excuse me if this is OT here. I'm trying to find out what would happen
    if I append my:

    Content-Type: application/x-javascript
    Content-Length: nnn

    <javascript data>

    To an http answer in transit.
    1) Does appending such a thing to an http answer which already has it's
    own content-type and length headers and data, is allowed ?
    2) How would a typical browser understand it ? Would it just ignore it
    ?

    If the answer to (1) is "no": what would you suggest to do ?
    I've thought of capturing the stream, and creating multi-part. The
    first part would be the captured one, and the second - the data I want
    to append. Does it seem as a good scheme to you ?

    Alex

  • Mike Willbanks

    #2
    Re: http headers

    Alex,
    [color=blue]
    > To an http answer in transit.
    > 1) Does appending such a thing to an http answer which already has it's
    > own content-type and length headers and data, is allowed ?
    > 2) How would a typical browser understand it ? Would it just ignore it
    > ?[/color]

    HTTP protocol is pretty much just like that. Say you were including a
    javascript document from php and exporting it that way. Anytime there
    is a src attribute the browser goes looking for that document in a
    seperate stream.

    So if you are looking to add that into the http stream for a single page
    the answer for 1 is no. And how it would understand it will depend on
    the browser and how it was coded. I would think that it would be ignored.

    Hope that helps,

    Mike

    Comment

    Working...