<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Droid Sans Mono'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Перестать жать на бэкенде и делать это на самом nginx, кажется, единственный вариант.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br />On 19 March 2015 16:37:31 Михаил Пульман wrote:<br /></p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Да, получается на nginx приходит сжатый ответ и инжект не срабатывает.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Подскажите каким образом можно произвести инжект js-скрипта в ответ, если на nginx со стороны сервера приложения приходит уже сжатый ответ ?</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Arial,Tahoma,Verdana,sans-serif'; font-size:12px; background-color:#ffffff;">С уважением, Михаил</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">19 марта 2015 г., 11:41 пользователь Aleksandr Sytar <<a href="mailto:sytar.alex@gmail.com"><span style=" text-decoration: underline; color:#89cacb;">sytar.alex@gmail.com</span></a>> написал:<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:45px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:45px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:45px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">19 марта 2015 г., 11:36 пользователь Михаил Пульман <<a href="mailto:pullmix@gmail.com"><span style=" text-decoration: underline; color:#89cacb;">pullmix@gmail.com</span></a>> написал:<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">содержимое inject.html следующего вида:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><!-- test --></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><script type="text/javascript"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">"код скрипта"</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"></script></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><!-- test --><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Соответственно содержимое в формате html и не сжато. Более глубокое тестирование показало что инжект происходит когда запрос приходит от браузеров chrome, opera и не происходит когда запрос приходит от ie или firefox. Содержимое inject.html пробовал разнообразное, начиная от html кода и заканчивая произвольным текстом, ситуация во всех случаях одинаковая.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:45px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">curl -v -I --compressed <a href="http://xn--______-7nfb9aidhlmdcxbjgzbc2ahahaae3ch8dikbhm5fwmwa0b"><span style=" text-decoration: underline; color:#89cacb;">http://урл_к_которому_мы_хотим_заинжектить_данные</span></a></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:45px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:45px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Если вы получите ошибку - значит сервер не умеет сжимать данные и всегда возвращает html к которому можно приклеить свой. Иначе, возвращаются сжатые данные, которые нужно предварительно распаковать.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Arial,Tahoma,Verdana,sans-serif'; font-size:12px; background-color:#ffffff;">С уважением, Михаил</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">18 марта 2015 г., 17:15 пользователь Maxim Dounin <<a href="mailto:mdounin@mdounin.ru"><span style=" text-decoration: underline; color:#89cacb;">mdounin@mdounin.ru</span></a>> написал:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:10px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hello!<br /><br />On Wed, Mar 18, 2015 at 04:58:28PM +0300, Михаил Пульман wrote:<br /><br />[...]<br /><br />> Суть в том что при любом запросе у сервера <a href="http://example01.ru"><span style=" text-decoration: underline; color:#89cacb;">example01.ru</span></a>, в ответ должен<br />> приходить ответ + Содержимое inject.html<br />> Содержимое inject.html добавляется к телу ответа не всегда. В чем может<br />> быть проблема?<br /><br />В том, что ответ не html (<a href="http://nginx.org/r/addition_types/ru"><span style=" text-decoration: underline; color:#89cacb;">http://nginx.org/r/addition_types/ru</span></a>)<br />или сжат.<br /><span style=" color:#888888;"><br />--<br />Maxim Dounin<br /></span><a href="http://nginx.org/"><span style=" text-decoration: underline; color:#89cacb;">http://nginx.org/</span></a><span style=" color:#888888;"><br /><br />_______________________________________________<br />nginx-ru mailing list<br /></span><a href="mailto:nginx-ru@nginx.org"><span style=" text-decoration: underline; color:#89cacb;">nginx-ru@nginx.org</span></a><span style=" color:#888888;"><br /></span><a href="http://mailman.nginx.org/mailman/listinfo/nginx-ru"><span style=" text-decoration: underline; color:#89cacb;">http://mailman.nginx.org/mailman/listinfo/nginx-ru</span></a></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br />_______________________________________________<br />nginx-ru mailing list<br /><a href="mailto:nginx-ru@nginx.org"><span style=" text-decoration: underline; color:#89cacb;">nginx-ru@nginx.org</span></a><br /><a href="http://mailman.nginx.org/mailman/listinfo/nginx-ru"><span style=" text-decoration: underline; color:#89cacb;">http://mailman.nginx.org/mailman/listinfo/nginx-ru</span></a><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br />_______________________________________________<br />nginx-ru mailing list<br /><a href="mailto:nginx-ru@nginx.org"><span style=" text-decoration: underline; color:#89cacb;">nginx-ru@nginx.org</span></a><br /><a href="http://mailman.nginx.org/mailman/listinfo/nginx-ru"><span style=" text-decoration: underline; color:#89cacb;">http://mailman.nginx.org/mailman/listinfo/nginx-ru</span></a><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /></p></body></html>