Skip to content
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

Don't honor Range header by default #3870

Closed
manniL opened this issue Sep 11, 2018 · 3 comments · Fixed by #4295
Closed

Don't honor Range header by default #3870

manniL opened this issue Sep 11, 2018 · 3 comments · Fixed by #4295

Comments

@manniL
Copy link
Member

manniL commented Sep 11, 2018

What problem does this feature solve?

If you are currently requesting a Nuxt page with a Range header (f.ex. curl -s -i -H 'Range: bytes=5000-10000' localhost:3000) the Nuxt application will return a 500

We should find a workaround or shouldn't honor Range headers at all (except enabled)

curl -s -i -H 'Range: bytes=0-10' localhost:3000 
HTTP/1.1 500 TypeError
Content-Type: text/json; charset=utf-8
Content-Length: 1927
Date: Tue, 11 Sep 2018 00:22:52 GMT
Connection: keep-alive

{
  "error": {
    "message": "Converting circular structure to JSON",
    "name": "TypeError",
    "frames": [
      {
        "file": "node_modules/serialize-javascript/index.js",
        "method": "serialize",
        "line": 76,
        "column": 20,
        "context": {
          "start": 71,
          "pre": "    var str;\n\n    // Creates a JSON string representation of the value.\n    // NOTE: Node 0.12 goes into slow mode with extra JSON.stringify() args.\n    if (options.isJSON && !options.space) {",
          "line": "        str = JSON.stringify(obj);",
          "post": "    } else {\n        str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space);\n    }\n\n    // Protects against `JSON.stringify()` returning `undefined`, by serializing"
        },
        "lang": "js",
        "open": "/__open-in-editor?file=/home/mannil/Programming/JS/nuxt-example-edge/node_modules/serialize-javascript/index.js:76:20"
      },
      {
        "file": "node_modules/nuxt-edge/dist/nuxt.js",
        "method": "Renderer.renderRoute",
        "line": 1930,
        "column": 50,
        "context": {
          "start": 1925,
          "pre": "      HEAD += context.renderResourceHints();\n    }\n\n    await this.nuxt.callHook('render:routeContext', context.nuxt);\n",
          "line": "    const serializedSession = `window.__NUXT__=${serialize(context.nuxt, {",
          "post": "      isJSON: true\n    })};`;\n\n    const cspScriptSrcHashSet = new Set();\n    if (this.options.render.csp) {"
        },
        "lang": "js",
        "open": "/__open-in-editor?file=/home/mannil/Programming/JS/nuxt-example-edge/node_modules/nuxt-edge/dist/nuxt.js:1930:50"
      },
      {
        "file": "internal/process/next_tick.js",
        "method": "process._tickCallback",
        "line": 68,
        "column": 7,
        "context": {},
        "lang": "js"
      }
    ]
  },
  "hasInternal": true
}                                                       
This feature request is available on Nuxt community (#c7717)
@stale
Copy link

stale bot commented Oct 31, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Oct 31, 2018
@stale stale bot closed this as completed Nov 7, 2018
@manniL
Copy link
Member Author

manniL commented Nov 7, 2018

Nooo!

@manniL manniL reopened this Nov 7, 2018
@stale stale bot removed the stale label Nov 7, 2018
@pi0 pi0 closed this as completed in #4295 Nov 8, 2018
@lock
Copy link

lock bot commented Dec 8, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants