Mozilla

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • POST data in nsIContentPolicy

    9 answers - 225 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Using an nsIContentPolicy I want to block a site request depending on
    HTTP PST data.
    What's the easiest way to do it?
    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.1 | | 509 bytes | |

    Frederik Vanderstraeten wrote:
    Using an nsIContentPolicy I want to block a site request depending on
    HTTP PST data.
    What's the easiest way to do it?

    There isn't one at all. For common cases (e.g. HTML form posts) you can examine
    aContext, maybe, but there's no way to detect PST data passed to
    nsIWebNavigation::LoadURI.

    Perhaps we should add this to the API
    -Boris

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.2 | | 792 bytes | |

    Boris Zbarsky schreef:
    Frederik Vanderstraeten wrote:
    >Using an nsIContentPolicy I want to block a site request depending on
    >HTTP PST data.
    >What's the easiest way to do it?


    There isn't one at all. For common cases (e.g. HTML form posts) you can
    examine aContext, maybe, but there's no way to detect PST data passed
    to nsIWebNavigation::LoadURI.

    Perhaps we should add this to the API
    -Boris

    What about observing http-on-modify-request?
    Will this always happen before a call to nsIContentPolicy? Will it
    contain the PST data?
    If so I could queue the information and get it in my content policy.

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.3 | | 505 bytes | |

    Frederik Vanderstraeten wrote:
    What about observing http-on-modify-request?
    Will this always happen before a call to nsIContentPolicy? Will it
    contain the PST data?
    If so I could queue the information and get it in my content policy.

    It will contain the PST data, but happens after the content policy call
    (http-on-modify-request happens right before sending the data to the
    network)

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.4 | | 685 bytes | |

    Christian Biesinger schreef:
    Frederik Vanderstraeten wrote:
    >What about observing http-on-modify-request?
    >Will this always happen before a call to nsIContentPolicy? Will it
    >contain the PST data?
    >If so I could queue the information and get it in my content policy.


    It will contain the PST data, but happens after the content policy call
    (http-on-modify-request happens right before sending the data to the
    network)

    :( Is there any way to still cancel the request at that time? any
    event which happens earlier?

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.5 | | 284 bytes | |

    Frederik Vanderstraeten wrote:
    :( Is there any way to still cancel the request at that time? any
    event which happens earlier?
    It should work. Just call cancel on the channel.
    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.6 | | 432 bytes | |

    Christian Biesinger schreef:
    Frederik Vanderstraeten wrote:
    >:( Is there any way to still cancel the request at that time?
    >any event which happens earlier?


    It should work. Just call cancel on the channel.

    great, didn't see nsIHttpChannel inherits from nsIRequest.
    Thanks

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.7 | | 620 bytes | |

    Christian Biesinger schreef:
    Frederik Vanderstraeten wrote:
    >What about observing http-on-modify-request?
    >Will this always happen before a call to nsIContentPolicy? Will it
    >contain the PST data?
    >If so I could queue the information and get it in my content policy.


    It will contain the PST data, but happens after the content policy call
    (http-on-modify-request happens right before sending the data to the
    network)

    So where exactly is the PST data?

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.8 | | 798 bytes | |

    Frederik Vanderstraeten schreef:
    Christian Biesinger schreef:
    >Frederik Vanderstraeten wrote:

    What about observing http-on-modify-request?
    Will this always happen before a call to nsIContentPolicy? Will it
    contain the PST data?
    If so I could queue the information and get it in my content policy.
    >>

    >It will contain the PST data, but happens after the content policy
    >call (http-on-modify-request happens right before sending the data to
    >the network)


    So where exactly is the PST data?

    I found out myself, you can read it with an nsIScriptableInputStream.

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.9 | | 286 bytes | |

    Frederik Vanderstraeten wrote:
    So where exactly is the PST data?
    QI to nsIUploadChannel and access uploadStream. Remember to rewind the
    stream when you're done reading it.
    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org

Re: POST data in nsIContentPolicy


max 4000 letters.
Your nickname that display:
In order to stop the spam: 7 + 6 =
QUESTION ON "Mozilla"

EMSDN.COM