Feature #2440

Make httpConnect return image when it gets 404 but Content-Length: >0 and Content-Type: image/jpeg

Added by Leonid Protasov almost 6 years ago. Updated almost 6 years ago.

Status:FixedStart date:12/30/2014
Priority:NormalDue date:
Assignee:Andreas Smas% Done:

100%

Category:General
Target version:4.10

Description

The link i got from youtube thumbnail properties:
https://i.ytimg.com/vi/default.jpg

The server reports 404 but in content it returns the image. Chrome displays it.

ST could behave the same if you set that link as the item's icon property...

Associated revisions

Revision 50796beb
Added by Andreas Smas almost 6 years ago

http: When loading images, always try to parse returned content

This makes it possible for us to display images that are returned as 404
errors such as: https://i.ytimg.com/vi/default.jpg

Fixes #2440

Change included in version 4.9.26

History

#1 Updated by Andreas Smas almost 6 years ago

  • Target version deleted (4.8)

#2 Updated by Andreas Smas almost 6 years ago

This is too big change in the HTTP client for 4.8

#3 Updated by Leonid Protasov almost 6 years ago

  • Target version set to 4.10

#4 Updated by Leonid Protasov almost 6 years ago

  • Subject changed from ST could display icons in appendItem the same as chrome does to Make httpConnect return image when it gets 404 but Content-Length: >0 and Content-Type: image/jpeg
HTTP            [DEBUG]: > GET /vi/default.jpg HTTP/1.1
HTTP            [DEBUG]: > User-Agent: Showtime Linux/x86_64 4.9.15.g10ac8.dirty
HTTP            [DEBUG]: > Connection: keep-alive
HTTP            [DEBUG]: > Accept: */*
HTTP            [DEBUG]: > Accept-Encoding: identity
HTTP            [DEBUG]: > Host: i.ytimg.com
HTTP            [DEBUG]: https://i.ytimg.com/vi/default.jpg: Response:
HTTP            [DEBUG]: < HTTP/1.1 404 Not Found
HTTP            [DEBUG]: < Date: Sat, 03 Jan 2015 08:42:35 GMT
HTTP            [DEBUG]: < Expires: Sat, 03 Jan 2015 08:43:05 GMT
HTTP            [DEBUG]: < Cache-Control: public, max-age=30
HTTP            [DEBUG]: < Content-Type: image/jpeg
HTTP            [DEBUG]: < X-Content-Type-Options: nosniff
HTTP            [DEBUG]: < Server: sffe
HTTP            [DEBUG]: < Content-Length: 1097
HTTP            [DEBUG]: < X-XSS-Protection: 1; mode=block
HTTP            [DEBUG]: < 
drain           [DEBUG]: 0x000000: ff d8 ff e0 00 10 4a 46  49 46 00 01 01 00 00 01    ......JFIF......
drain           [DEBUG]: 0x000010: 00 01 00 00 ff db 00 84  00 05 03 04 07 05 07 05    ................
drain           [DEBUG]: 0x000020: 05 05 05 06 05 08 05 06  05 05 05 05 08 05 05 07    ................
drain           [DEBUG]: 0x000030: 05 08 05 05 05 09 06 08  09 05 05 13 0a 1c 0b 07    ................
drain           [DEBUG]: 0x000040: 08 1a 09 08 05 0e 21 18  1a 1d 11 1f 13 1f 13 0b    ......!.........
drain           [DEBUG]: 0x000050: 22 18 22 1e 18 1c 12 13  12 01 05 05 05 07 06 07    ".".............
drain           [DEBUG]: 0x000060: 05 08 08 05 12 08 05 08  12 12 12 12 12 12 12 12    ................
drain           [DEBUG]: 0x000070: 12 12 12 12 12 12 12 12  12 12 12 12 12 12 12 12    ................
drain           [DEBUG]: 0x000080: 12 12 12 12 12 12 12 12  12 12 12 12 12 12 12 12    ................
drain           [DEBUG]: 0x000090: 12 12 12 12 12 12 12 12  12 12 ff c0 00 11 08 00    ................
drain           [DEBUG]: 0x0000a0: 5a 00 78 03 01 22 00 02  11 01 03 11 01 ff c4 00    Z.x.."..........
drain           [DEBUG]: 0x0000b0: 1b 00 01 00 02 03 01 01  00 00 00 00 00 00 00 00    ................
drain           [DEBUG]: 0x0000c0: 00 00 00 01 04 02 03 07  06 05 ff c4 00 3d 10 00    .............=..
drain           [DEBUG]: 0x0000d0: 02 01 02 03 03 07 06 0d  05 00 00 00 00 00 00 00    ................
drain           [DEBUG]: 0x0000e0: 02 01 03 04 05 11 12 06  13 21 07 22 31 32 41 52    .........!."12AR
drain           [DEBUG]: 0x0000f0: 61 14 42 71 72 92 d2 15  55 81 84 91 94 b1 c1 c2    a.Bqr...U.......
drain           [DEBUG]: 0x000100: c3 d1 d3 f0 17 51 62 64  b3 ff c4 00 14 01 01 00    .....Qbd........
drain           [DEBUG]: 0x000110: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 ff    ................
drain           [DEBUG]: 0x000120: c4 00 14 11 01 00 00 00  00 00 00 00 00 00 00 00    ................
drain           [DEBUG]: 0x000130: 00 00 00 00 00 ff da 00  0c 03 01 00 02 11 03 11    ................
drain           [DEBUG]: 0x000140: 00 3f 00 ef 40 00 00 00  00 98 82 74 81 88 32 d0    [email protected]
drain           [DEBUG]: 0x000150: 34 01 88 32 d0 34 81 88  26 60 80 00 00 00 00 00    4..2.4..&`......
drain           [DEBUG]: 0x000160: 00 10 66 aa 62 a5 8a 2a  01 29 1b 96 81 f2 36 83    ..f.b..*.)....6.
drain           [DEBUG]: 0x000170: 6a ec 70 56 5a 37 1b da  d5 9a 15 da de 8c 43 3a    j.pVZ7........C:
drain           [DEBUG]: 0x000180: 23 75 66 b3 cc c2 a7 87  1c fc 0f 91 3c a8 5a af    #uf.........<.Z.
drain           [DEBUG]: 0x000190: 57 0a ba 6f 4d 6b 75 fd  40 f6 1b 81 b8 3c 5c f2    [email protected]<\.
drain           [DEBUG]: 0x0001a0: a7 4f cd c1 df e5 bd 48  fc b3 1f ea a2 fc 4d 3f    .O.....H......M?
drain           [DEBUG]: 0x0001b0: 5e 5f da 03 db 6e 0c 5a  81 e3 57 95 3a 3e 76 0f    ^_...n.Z..W.:>v.
drain           [DEBUG]: 0x0001c0: 57 fc b4 de d2 9f cb 83  6c 72 9f 68 dd 38 65 e2    W.......lr.h.8e.
drain           [DEBUG]: 0x0001d0: 7a 2a da b7 df 00 7a 77  a6 69 65 34 e0 1b 45 65    z*....zw.ie4..Ee
drain           [DEBUG]: 0x0001e0: 8d 43 f9 23 3a 3d 28 d4  f6 f5 15 52 b4 27 46 a5    .C.#:=(....R.'F.
drain           [DEBUG]: 0x0001f0: e3 30 cb e8 92 dd 65 02  b8 0c 00 00 00 00 00 c9    .0....e.........
drain           [DEBUG]: 0x000200: 0b b6 8b aa 54 a4 85 fb  39 e2 a0 70 ac 7a e2 6e    ....T...9..p.z.n
drain           [DEBUG]: 0x000210: 2f 31 0b 86 6d 53 56 ee  e5 b5 74 f3 56 b3 22 fc    /1..mSV...t.V.".
drain           [DEBUG]: 0x000220: 9a 55 20 a6 4d 49 e7 3b  77 9e a3 7b 4f 25 bc 12    .U .MI.;w..{O%..
drain           [DEBUG]: 0x000230: c2 71 0b ab 5b 24 78 a5  37 55 56 96 b6 e2 ab ab    .q..[$x.7UV.....
drain           [DEBUG]: 0x000240: a6 74 f6 f0 86 02 98 3d  36 de 6c ac 60 53 69 29    .t.....=6.l.`Si)
drain           [DEBUG]: 0x000250: 75 37 09 75 bd 5e 7a 2a  55 57 a3 a6 5b 9b 13 94    u7.u.^z*UW..[...
drain           [DEBUG]: 0x000260: ae 4c a5 cb ad 86 dd 61  3f 0c 79 6e aa 8b 6d 4e    .L.....a?.yn..mN
drain           [DEBUG]: 0x000270: f5 ad f7 4b b9 dd 3a c4  e9 5a b9 e7 af 26 5f 0c    ...K..:..Z...&_.
drain           [DEBUG]: 0x000280: c0 f1 a0 f5 7b 0b b2 11  8e a5 d5 6a b7 73 6a b4    ....{......j.sj.
drain           [DEBUG]: 0x000290: 6a 2d 15 54 a4 ae ed 55  93 5e 6d c6 32 5c a5 4f    j-.T...U.^m.2\.O
drain           [DEBUG]: 0x0002a0: 37 88 db 4d a5 7b 8b 56  98 76 b5 ab 56 dd 9d 7a    7..M.{.V.v..V..z
drain           [DEBUG]: 0x0002b0: ac d4 9e 52 65 7c 38 01  f5 b9 3f af 34 71 4c 35    ...Re|8...?.4qL5
drain           [DEBUG]: 0x0002c0: b5 69 8a b5 5a dd fc 56  b2 32 65 f4 ca 9d 82 e6    .i..Z..V.2e.....
drain           [DEBUG]: 0x0002d0: 0e 27 b2 ed a7 10 c3 25  7a 56 f2 d3 fe ca 76 eb    .'.....%zV....v.
drain           [DEBUG]: 0x0002e0: bf 38 0a 2e 41 2e 40 00  00 00 00 12 85 db 46 e3    [email protected]
drain           [DEBUG]: 0x0002f0: 1e 92 8c 1b e9 3e 90 38  5d ca 4a 55 ac 8d d2 95    .....>.8].JU....
drain           [DEBUG]: 0x000300: 6a a3 7a d1 56 62 7e c3  1a 6f 29 2a e8 d2 8c 92    j.z.Vb~..o)*....
drain           [DEBUG]: 0x000310: b2 8e ad 94 ab 2f 18 95  6e c9 cc fb 7b 6d 84 d4    ...../..n...{m..
drain           [DEBUG]: 0x000320: b1 bb ba 76 49 dc dd 55  a9 71 6f 5a 17 99 2b 55    ...vI..U.qoZ..+U
drain           [DEBUG]: 0x000330: e5 e5 5a 7b 1a 26 5a 0f  85 aa 3b d0 05 ac 42 fe    ..Z{.&Z...;...B.
drain           [DEBUG]: 0x000340: e2 f5 96 ad ed d5 6b a7  58 d0 8f 52 ab 3b 2a 74    ......k.X..R.;*t
drain           [DEBUG]: 0x000350: e4 bf da 09 7c 4a e5 a8  2d 94 dd d7 6b 75 9d 4b    ....|J..-...ku.K
drain           [DEBUG]: 0x000360: 6b 35 5f 73 1a 5b 38 e6  74 65 9f 12 a6 64 81 6b    k5_s.[8.te...d.k
drain           [DEBUG]: 0x000370: 0f c4 ae 6c b5 f9 25 dd  7b 5d ec 69 ab bb aa c9    ...l..%.{].i....
drain           [DEBUG]: 0x000380: a9 7b 35 7d 25 59 9f e4  f1 69 6e d9 66 ed 92 33    .{5}%Y...in.f..3
drain           [DEBUG]: 0x000390: 1a a3 bd 00 7d 4d 92 4d  78 8e 18 bf ee 5b 37 b2    ....}M.Mx....[7.
drain           [DEBUG]: 0x0003a0: f0 f3 f6 1d a6 e1 8e 5d  c9 ae 15 52 b5 dd 2b e6    .......]...R..+.
drain           [DEBUG]: 0x0003b0: 49 5a 36 9b c7 de ca e4  af 5a 52 51 12 97 7a 63    IZ6......ZRQ..zc
drain           [DEBUG]: 0x0003c0: 56 73 97 de 74 ba 8c 06  a6 20 48 00 00 00 00 00    Vs..t.... H.....
drain           [DEBUG]: 0x0003d0: 4a c9 00 0d 9a b5 73 59  61 a3 bb 2a b3 1e c9 ad    J.....sYa..*....
drain           [DEBUG]: 0x0003e0: ad ad df af 6b 6f 3e b5  bd 19 fc 20 66 06 a6 c3    ....ko>.... f...
drain           [DEBUG]: 0x0003f0: 2c 5b ad 87 d9 b7 cd 68  fb a6 3f 04 58 7c 59 67    ,[.....h..?.X|Yg
drain           [DEBUG]: 0x000400: f5 6a 3f a1 bf 31 98 1a  d7 0c b2 5e ae 1f 66 bf    .j?..1.....^..f.
drain           [DEBUG]: 0x000410: 34 a3 ee 9b 56 de 82 75  2d 6d d3 d5 b7 a2 bf 84    4...V..u-m......
drain           [DEBUG]: 0x000420: 8c c6 60 6c 97 ec ec 5e  aa c7 05 8f 55 7b 0c 26    ..`l...^....U{.&
drain           [DEBUG]: 0x000430: 48 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    H...............
drain           [DEBUG]: 0x000440: 00 00 00 00 00 00 7f ff  d9                         .........
HTTP            [DEBUG]: Parking connection to i.ytimg.com:443 (id=6)

#5 Updated by Andreas Smas almost 6 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Also available in: Atom PDF