-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compress/flate: fails to decompress zlib format compressed data #10377
Labels
Comments
Did you try it with go 1.4.2? It might be fixed already. |
@Thomasdezeeuw , I've just tried it, looks like the same problem: $ docker run -it --rm -v $(pwd):/root/test -w /root/test golang:1.4.2 bash
root@86a293d14e46:~/test# go version
go version go1.4.2 linux/amd64
root@86a293d14e46:~/test# go run uncompress.go
File content:
[120 156 181 80 65 78 195 48 16 252 10 242 57 69 118 226 166 38 247 156 64 42 42 130 107 100 156 165 88 196 118 149 93 35 160 234 223 89 183 61 112 42 226 192 109 118 118 102 103 180 123 65 62 0 146 13 59 209 237 5 189 15 8 78 116 74 215 70 27 211 174 100 85 184 124 34 111 86 82 171 67 37 144 102 31 183 195 15 167 168 165 90 46 164 94 72 115 165 100 87 235 174 145 215 39 189 168 68 72 209 83 154 7 22 83 70 86 67 180 207 19 140 188 114 41 4 27 71 44 225 155 254 169 223 60 244 195 221 122 125 251 120 95 24 103 221 43 20 144 50 161 31 143 16 179 115 128 8 108 225 114 47 214 79 121 62 15 232 191 224 8 74 51 6 92 213 71 130 57 218 233 175 78 182 142 30 223 254 35 91 53 77 219 94 118 47 165 50 210 148 18 148 232 124 128 31 104 183 151 91 176 126 55 167 143 207 95 3 15 229 180 155 60 68 42 159 231 241 27 47 165 167 25]
panic: flate: corrupt input before offset 5
goroutine 1 [running]:
main.main()
/root/test/uncompress.go:20 +0x379
goroutine 2 [runnable]:
runtime.forcegchelper()
/usr/src/go/src/runtime/proc.go:90
runtime.goexit()
/usr/src/go/src/runtime/asm_amd64.s:2232 +0x1
goroutine 3 [runnable]:
runtime.bgsweep()
/usr/src/go/src/runtime/mgc0.go:82
runtime.goexit()
/usr/src/go/src/runtime/asm_amd64.s:2232 +0x1
goroutine 4 [runnable]:
runtime.runfinq()
/usr/src/go/src/runtime/malloc.go:712
runtime.goexit()
/usr/src/go/src/runtime/asm_amd64.s:2232 +0x1
exit status 2 |
mikioh
changed the title
"compress/flate" fails to decompress valid string
compress/flate: fails to decompress valid string
Apr 8, 2015
You need to use http://tools.ietf.org/html/rfc1950 instead of http://tools.ietf.org/html/rfc1951. |
mikioh
changed the title
compress/flate: fails to decompress valid string
compress/flate: fails to decompress zlib format compressed data
Apr 8, 2015
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
First I apologize in advance in case if I just misunderstood some basics of Go language. I work with a REST API that compresses HTTP responses with deflate algorithm. So I wasn't able to decompress JSON object from HTTP body with Go standard library tools. Please check the test file (actually it is a dumped HTTP body) and code below:
Input data
File with deflate encoded JSON object
Let's make sure that this file can be decompressed and even contains valid JSON:
Source code
I am going to decompress it with Go:
Error
Version
I use Ubuntu 14.10, Go 1.2.1:
Any help will be appreciated.
The text was updated successfully, but these errors were encountered: