Page MenuHomePhabricator

Http response content is sometimes broken when gzip is not set
Open, Needs TriagePublic

Description

Reported by Antigng in zhwp village pump:

$ TZ=UTC diff -u <(curl 'https://zh.wikipedia.org/w/index.php?title=%E9%AB%98%E9%9B%84%E5%B8%82%E6%97%85%E9%81%8A%E6%99%AF%E9%BB%9E%E5%88%97%E8%A1%A8&action=raw' 2>/dev/null | hd) <(curl 'https://zh.wikipedia.org/w/index.php?title=%E9%AB%98%E9%9B%84%E5%B8%82%E6%97%85%E9%81%8A%E6%99%AF%E9%BB%9E%E5%88%97%E8%A1%A8&action=raw' -H 'accept-encoding: gzip' 2>/dev/null | gzip -d | hd)
--- /dev/fd/63	2016-05-01 04:44:05.898318471 +0000
+++ /dev/fd/62	2016-05-01 04:44:05.902318576 +0000
@@ -2045,5 +2045,5 @@
 00007fc0  5b 5b 43 61 74 65 67 6f  72 79 3a e9 ab 98 e9 9b  |[[Category:.....|
 00007fd0  84 e5 b8 82 e5 88 97 e8  a1 a8 7c 4b 5d 5d 0a 5b  |..........|K]].[|
 00007fe0  5b 43 61 74 65 67 6f 72  79 3a e9 ab 98 e9 9b 84  |[Category:......|
-00007ff0  e5 b8 82 e5 bb 9f e5 ae  77 66 c7 14 52           |........wf..R|
+00007ff0  e5 b8 82 e5 bb 9f e5 ae  87 7c 47 5d 5d           |.........|G]]|
 00007ffd
$

Event Timeline

liangent created this task.May 1 2016, 4:44 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 1 2016, 4:44 AM

Another broken sample:

$ TZ=UTC diff -u <(curl 'https://zh.wikipedia.org/w/index.php?title=2006%E5%B9%B4%E5%A4%AA%E5%B9%B3%E6%B4%8B%E9%A2%B6%E9%A2%A8%E5%AD%A3&action=raw' 2>/dev/null | hd) <(curl 'https://zh.wikipedia.org/w/index.php?title=2006%E5%B9%B4%E5%A4%AA%E5%B9%B3%E6%B4%8B%E9%A2%B6%E9%A2%A8%E5%AD%A3&action=raw' -H 'accept-encoding: gzip' 2>/dev/null | gzip -d | hd)
--- /dev/fd/63	2016-05-01 04:45:56.681249267 +0000
+++ /dev/fd/62	2016-05-01 04:45:56.681249267 +0000
@@ -6141,5 +6141,5 @@
 00017fc0  5b 5b 43 61 74 65 67 6f  72 79 3a 32 30 30 36 e5  |[[Category:2006.|
 00017fd0  b9 b4 e5 a4 aa e5 b9 b3  e6 b4 8b e9 a2 b6 e9 a2  |................|
 00017fe0  a8 e5 ad a3 7c 20 5d 5d  0a 7b 7b 46 65 61 74 75  |....| ]].{{Featu|
-00017ff0  72 65 64 20 61 72 74 69  77 66 c7 14 52           |red artiwf..R|
+00017ff0  72 65 64 20 61 72 74 69  63 6c 65 7d 7d           |red article}}|
 00017ffd
$
Antigng_ added a subscriber: Antigng_.EditedMay 2 2016, 2:14 PM

As reported by User:Kanashimi, some api query output is broken, either. For example, https://zh.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content|timestamp&titles=LGBT%E7%9B%B8%E5%85%B3%E7%94%B5%E5%BD%B1%E5%88%97%E8%A1%A8&rvlimit=1&format=json&utf8 returns unnecessary "w6" at the end.

liangent renamed this task from action=raw output is sometimes broken when gzip is not set to Http response content is sometimes broken when gzip is not set.May 2 2016, 9:27 PM
Restricted Application added a subscriber: Cosine02. · View Herald TranscriptDec 21 2016, 9:58 AM

@Shizhao When you have free time, can you please explain how this is related to I18n?

Shizhao removed a project: I18n.Aug 2 2018, 2:16 AM