wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

jsonp invalid object fix #152

Closed pilat closed 10 years ago

pilat commented 10 years ago

If i use callback option with sample template push_stream_message_template "{\"id\":~id~,\"channel\":\"~channel~\",\"text\":\"~text~\", \"tag\":\"~tag~\", \"time\":\"~time~\", \"eventid\":\"~event-id~\"}";

and get old messages i catch invalid javascript: callback1([{"id":1,"channel":"lupd2","text":"tt1", "tag":"1", "time":"Thu, 31 Jul 2014 00:36:03 GMT", "eventid":""},{"id":4,"channel":"lupd2","text":"tt1", "tag":"1", "time":"Thu, 31 Jul 2014 00:36:06 GMT", "eventid":""},]);

last comma is needless. p.s. sorry, maybe my fix ugly. I do not have experience in the development by c