wiki-v1 icon indicating copy to clipboard operation
wiki-v1 copied to clipboard

Content-Length is not the same as Actual Data for html

Open mozhu1024 opened this issue 6 years ago • 3 comments

When I install Wiki.js on Docker, it was some error.

Content-Length is not the same as Actual Data

Actual Data lost the last character.

But, when I request static resources, it was success!

What's problem? What should I do ?


bash-4.3# curl --trace-ascii /logs/debug 127.0.0.1:3000
<!DOCTYPE html><html><head><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#009688"><meta name="msapplication-TileColor" content="#009688"><meta name="msapplication-TileImage" content="https://xxxxxxxxxx.com/favicons/ms-icon-144x144.png"><title>CTF Wiki</title><link rel="apple-touch-icon" sizes="57x57" href="https://xxxxxxxxxx.com/favicons/apple-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="https://xxxxxxxxxx.com/favicons/apple-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="https://xxxxxxxxxx.com/favicons/apple-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="https://xxxxxxxxxx.com/favicons/apple-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="https://xxxxxxxxxx.com/favicons/apple-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="https://xxxxxxxxxx.com/favicons/apple-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="https://xxxxxxxxxx.com/favicons/apple-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="https://xxxxxxxxxx.com/favicons/apple-icon-152x152.png"><link rel="apple-touch-icon" sizes="180x180" href="https://xxxxxxxxxx.com/favicons/apple-icon-180x180.png"><link rel="icon" type="image/png" sizes="192x192" href="https://xxxxxxxxxx.com/favicons/android-icon-192x192.png"><link rel="icon" type="image/png" sizes="32x32" href="https://xxxxxxxxxx.com/favicons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="96x96" href="https://xxxxxxxxxx.com/favicons/favicon-96x96.png"><link rel="icon" type="image/png" sizes="16x16" href="https://xxxxxxxxxx.com/favicons/favicon-16x16.png"><link rel="manifest" href="https://xxxxxxxxxx.com/manifest.json"><script>var siteLang = 'en';
var siteRoot = 'https://xxxxxxxxxx.com';
</script><script type="text/javascript" src="https://xxxxxxxxxx.com/js/vendor.js"></script><script type="text/javascript" src="https://xxxxxxxxxx.com/js/app.js"></script></head><body><div class="has-stickynav is-primary-indigo is-alternate-blue-grey" id="root"><div id="header-container"><nav class="nav is-indigo" id="header" ref="header"><div class="nav-left"><a class="nav-item" href="/"><h1><i class="nc-icon-outline ui-2_layers"></i>CTF Wiki</h1></a></div><div class="nav-center"></div><span class="nav-toggle"><span></span><span></span><span></span></span><div class="nav-right"><loading-spinner></loading-spinner></div></nav></div><alert></alert><main><div class="container"><div class="welcome"><img src="/images/logo.png" alt="Wiki.js"><h1>Welcome to your wiki!</h1><h2>Let's get started and create the home page.</h2><a class="button is-indigo" href="/create/home">Create Home Page</a></div></div></main><footer class="footer is-blue-grey" ref="footer"><span>Powered by <a href="https://github.com/Requarks/wiki">Wiki.js</a>.</span><ul><li><a href="/">Home</a></li><li><a href="#root">Return to top</a></li></ul></footer></div></body></htmlcurl: (18) transfer closed with 1 bytes remaining to read
== Info: Rebuilt URL to: 127.0.0.1:3000/
== Info:   Trying 127.0.0.1...
== Info: TCP_NODELAY set
== Info: Connected to 127.0.0.1 (127.0.0.1) port 3000 (#0)
=> Send header, 78 bytes (0x4e)
0000: GET / HTTP/1.1
0010: Host: 127.0.0.1:3000
0026: User-Agent: curl/7.61.0
003f: Accept: */*
004c:
<= Recv header, 17 bytes (0x11)
0000: HTTP/1.1 200 OK
<= Recv header, 23 bytes (0x17)
0000: X-Frame-Options: deny
<= Recv header, 33 bytes (0x21)
0000: X-XSS-Protection: 1; mode=block
<= Recv header, 33 bytes (0x21)
0000: X-Content-Type-Options: nosniff
<= Recv header, 26 bytes (0x1a)
0000: X-UA-Compatible: IE=edge
<= Recv header, 30 bytes (0x1e)
0000: Referrer-Policy: same-origin
<= Recv header, 40 bytes (0x28)
0000: Content-Type: text/html; charset=utf-8
<= Recv header, 22 bytes (0x16)
0000: Content-Length: 3052
<= Recv header, 43 bytes (0x2b)
0000: ETag: W/"bec-wgx2SZi31S52HWyNu5M9u7bKoIs"
<= Recv header, 123 bytes (0x7b)
0000: set-cookie: wikijs.sid=s%3AuBsn5aLE3Gxu-LNaD_kjguWpnI2U00QM.62tw
0040: iuE5O2JNMseUiQmcUVc5Bj0HYRKRlw9vcnpsI9E; Path=/; HttpOnly
<= Recv header, 23 bytes (0x17)
0000: Vary: Accept-Encoding
<= Recv header, 37 bytes (0x25)
0000: Date: Thu, 23 Aug 2018 20:50:45 GMT
<= Recv header, 24 bytes (0x18)
0000: Connection: keep-alive
<= Recv header, 2 bytes (0x2)
0000:
<= Recv data, 3051 bytes (0xbeb)
0000: <!DOCTYPE html><html><head><meta http-equiv="X-UA-Compatible" co
0040: ntent="IE=edge"><meta charset="UTF-8"><meta name="viewport" cont
0080: ent="width=device-width, initial-scale=1"><meta name="theme-colo
00c0: r" content="#009688"><meta name="msapplication-TileColor" conten
0100: t="#009688"><meta name="msapplication-TileImage" content="https:
0140: //xxxxxxxxxx.com/favicons/ms-icon-144x144.png"><title>CTF Wiki</
0180: title><link rel="apple-touch-icon" sizes="57x57" href="https://x
01c0: xxxxxxxxx.com/favicons/apple-icon-57x57.png"><link rel="apple-to
0200: uch-icon" sizes="60x60" href="https://xxxxxxxxxx.com/favicons/ap
0240: ple-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" h
0280: ref="https://xxxxxxxxxx.com/favicons/apple-icon-72x72.png"><link
02c0:  rel="apple-touch-icon" sizes="76x76" href="https://wxxxxxxxxx.c
0300: om/favicons/apple-icon-76x76.png"><link rel="apple-touch-icon" s
0340: izes="114x114" href="https://xxxxxxxxxx.com/favicons/apple-icon-
0380: 114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="
03c0: https://xxxxxxxxxx.com/favicons/apple-icon-120x120.png"><link re
0400: l="apple-touch-icon" sizes="144x144" href="https://wxxxxxxxxx.co
0440: m/favicons/apple-icon-144x144.png"><link rel="apple-touch-icon"
0480: sizes="152x152" href="https://xxxxxxxxxx.com/favicons/apple-icon
04c0: -152x152.png"><link rel="apple-touch-icon" sizes="180x180" href=
0500: "https://xxxxxxxxxx.com/favicons/apple-icon-180x180.png"><link r
0540: el="icon" type="image/png" sizes="192x192" href="https://xxxxxxx
0580: xxx.com/favicons/android-icon-192x192.png"><link rel="icon" type
05c0: ="image/png" sizes="32x32" href="https://xxxxxxxxxx.com/favicons
0600: /favicon-32x32.png"><link rel="icon" type="image/png" sizes="96x
0640: 96" href="https://xxxxxxxxxx.com/favicons/favicon-96x96.png"><li
0680: nk rel="icon" type="image/png" sizes="16x16" href="https://xxxxx
06c0: xxxxx.com/favicons/favicon-16x16.png"><link rel="manifest" href=
0700: "https://xxxxxxxxxx.com/manifest.json"><script>var siteLang = 'e
0740: n';.var siteRoot = 'https://xxxxxxxxxx.com';.</script><script ty
0780: pe="text/javascript" src="https://xxxxxxxxxx.com/js/vendor.js"><
07c0: /script><script type="text/javascript" src="https://wxxxxxxxxx.c
0800: om/js/app.js"></script></head><body><div class="has-stickynav is
0840: -primary-indigo is-alternate-blue-grey" id="root"><div id="heade
0880: r-container"><nav class="nav is-indigo" id="header" ref="header"
08c0: ><div class="nav-left"><a class="nav-item" href="/"><h1><i class
0900: ="nc-icon-outline ui-2_layers"></i>CTF Wiki</h1></a></div><div c
0940: lass="nav-center"></div><span class="nav-toggle"><span></span><s
0980: pan></span><span></span></span><div class="nav-right"><loading-s
09c0: pinner></loading-spinner></div></nav></div><alert></alert><main>
0a00: <div class="container"><div class="welcome"><img src="/images/lo
0a40: go.png" alt="Wiki.js"><h1>Welcome to your wiki!</h1><h2>Let's ge
0a80: t started and create the home page.</h2><a class="button is-indi
0ac0: go" href="/create/home">Create Home Page</a></div></div></main><
0b00: footer class="footer is-blue-grey" ref="footer"><span>Powered by
0b40:  <a href="https://github.com/Requarks/wiki">Wiki.js</a>.</span><
0b80: ul><li><a href="/">Home</a></li><li><a href="#root">Return to to
0bc0: p</a></li></ul></footer></div></body></html

== Info:   Trying 127.0.0.1...
== Info: TCP_NODELAY set
== Info: Connected to 127.0.0.1 (127.0.0.1) port 3000 (#0)
=> Send header, 91 bytes (0x5b)
0000: GET /manifest.json HTTP/1.1
001d: Host: 127.0.0.1:3000
0033: User-Agent: curl/7.61.0
004c: Accept: */*
0059:
<= Recv header, 17 bytes (0x11)
0000: HTTP/1.1 200 OK
<= Recv header, 23 bytes (0x17)
0000: X-Frame-Options: deny
<= Recv header, 33 bytes (0x21)
0000: X-XSS-Protection: 1; mode=block
<= Recv header, 33 bytes (0x21)
0000: X-Content-Type-Options: nosniff
<= Recv header, 26 bytes (0x1a)
0000: X-UA-Compatible: IE=edge
<= Recv header, 30 bytes (0x1e)
0000: Referrer-Policy: same-origin
<= Recv header, 22 bytes (0x16)
0000: Accept-Ranges: bytes
<= Recv header, 39 bytes (0x27)
0000: Cache-Control: public, max-age=604800
<= Recv header, 46 bytes (0x2e)
0000: Last-Modified: Thu, 02 Aug 2018 23:56:05 GMT
<= Recv header, 27 bytes (0x1b)
0000: ETag: W/"3f5-164fd11e208"
<= Recv header, 32 bytes (0x20)
0000: Content-Type: application/json
<= Recv header, 22 bytes (0x16)
0000: Content-Length: 1013
<= Recv header, 23 bytes (0x17)
0000: Vary: Accept-Encoding
<= Recv header, 37 bytes (0x25)
0000: Date: Thu, 23 Aug 2018 21:04:55 GMT
<= Recv header, 24 bytes (0x18)
0000: Connection: keep-alive
<= Recv header, 2 bytes (0x2)
0000:
<= Recv data, 1013 bytes (0x3f5)
0000: {.  "background_color": "#fbfbfc",.  "display": "standalone",.
0040: "icons": [.    {.      "src": "\/favicons\/android-icon-36x36.pn
0080: g",.      "sizes": "36x36",.      "type": "image\/png",.      "d
00c0: ensity": "0.75".    },.    {.      "src": "\/favicons\/android-i
0100: con-48x48.png",.      "sizes": "48x48",.      "type": "image\/pn
0140: g",.      "density": "1.0".    },.    {.      "src": "\/favicons
0180: \/android-icon-72x72.png",.      "sizes": "72x72",.      "type":
01c0:  "image\/png",.      "density": "1.5".    },.    {.      "src":
0200: "\/favicons\/android-icon-96x96.png",.      "sizes": "96x96",.
0240:     "type": "image\/png",.      "density": "2.0".    },.    {.
0280:     "src": "\/favicons\/android-icon-144x144.png",.      "sizes"
02c0: : "144x144",.      "type": "image\/png",.      "density": "3.0".
0300:     },.    {.      "src": "\/favicons\/android-icon-192x192.png"
0340: ,.      "sizes": "192x192",.      "type": "image\/png",.      "d
0380: ensity": "4.0".    }.  ],.  "name": "Wiki",.  "short_name": "Wik
03c0: i",.  "start_url": "/",.  "theme_color": "#3f51b5".}.
== Info: Connection #0 to host 127.0.0.1 left intact

mozhu1024 avatar Aug 23 '18 21:08 mozhu1024

What are you trying to do? Wiki.js is meant to be used in a browser, which works perfectly fine.

NGPixel avatar Aug 26 '18 15:08 NGPixel

I would deploy on my server, but it responded 504 Gateway Time-out.

Then I found that!

I try another server, it's still a problem.

image

mozhu1024 avatar Aug 26 '18 17:08 mozhu1024

same problem to me, delete node_modules and npm install solved this problem.

FROM requarks/wiki:latest

WORKDIR /var/wiki

RUN rm -rf node_modules

RUN npm install --production

EXPOSE 3000

CMD ["node", "server/index.js"]

pansinm avatar Jan 06 '19 03:01 pansinm