Hi, I am working on a C++ XPCOM component which encrypts and decrypts the HTTP request and response using certain algorithms.
I have a custom StreamListener class which decrypts the received encrypted response in OnDataAvailable() method and then calls the OnDataAvailable() method of the original listener by sending the decrypted data. I am facing a problem displaying contents with any MIME types which need a plugin. I am testing it with PDF files but I think it will pretty much be the same for any other applications. Since the original URL is encypted in the HTTP request, Firefox does not set the appropriate content-type. If I set the content-type, explicitly (for testing), in OnStartRequest() of the StreamListener, the plug-in is invoked but I get an error message saying that the file does not begin with "%PDF-" and hence nothing is displayed. (The file that I am trying to view is a valid PDF file and the decrypted response begins with %PDF- in this case.) Setting the content-type anywhere after that (in onDataAvailable() or in onStopRequest() methods) is ineffective. At what point, are the plug-ins selected when we are listening using the StreamListener ? Are there any additional checks made by Firefox to determine whether a file is a valid PDF file (other than checking the beginning data) ? If someone could point me to the code where it is happening, I really appreciate it. Thanks ! _______________________________________________ dev-tech-xpcom mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-xpcom
