cnken / substitutions4nginx

Automatically exported from code.google.com/p/substitutions4nginx
3 stars 3 forks source link

不能过滤json文件 #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
把subs_filter_types设为text/json或application/json都不行

Original issue reported on code.google.com by elden...@gmail.com on 13 Jan 2011 at 3:42

GoogleCodeExporter commented 9 years ago
可能几个原因:
1, json在后端被压缩了
2,json没有包含任何换行符
3,后端给的content 
type跟你的配置不一样,你能帖一下json回复的HTTP header吗?

Original comment by yaoweibin@gmail.com on 14 Jan 2011 at 4:53

GoogleCodeExporter commented 9 years ago
确实被gzip压缩过了。只有一行,没有换行符。
content type没错

Accept: application/json
Accept-Encoding: gzip, deflate

用自带的可以过滤,就是不支持正则。

Original comment by elden...@gmail.com on 14 Jan 2011 at 4:13

GoogleCodeExporter commented 9 years ago
第一行末尾加一个换行符看看

Original comment by yaoweibin@gmail.com on 15 Jan 2011 at 2:37

GoogleCodeExporter commented 9 years ago
来源我控制不了,nginx有附加字符的模块吗?

Original comment by elden...@gmail.com on 15 Jan 2011 at 12:45

GoogleCodeExporter commented 9 years ago
你好,请问现在的版本解决这个问题了吗?

Original comment by elden...@gmail.com on 29 Apr 2011 at 10:23

GoogleCodeExporter commented 9 years ago
你给我一个例子看看吧,有时候反向代理的时候,没有换行��
�很难判断数据有没有传输结束。

Original comment by nbubi...@gmail.com on 29 Apr 2011 at 10:28

GoogleCodeExporter commented 9 years ago
比如这条API返回的JSON字符串就不行。  
http://developer.getcloudapp.com/list-items

Original comment by elden...@gmail.com on 29 Apr 2011 at 1:53

GoogleCodeExporter commented 9 years ago
我五一回来会测试,谢谢

Original comment by yaoweibin@gmail.com on 29 Apr 2011 at 2:41

GoogleCodeExporter commented 9 years ago
好的,谢谢

Original comment by elden...@gmail.com on 29 Apr 2011 at 6:23