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

Bad content-length header #1094

Closed
SeanHayes opened this issue Mar 7, 2018 · 4 comments
Closed

Bad content-length header #1094

SeanHayes opened this issue Mar 7, 2018 · 4 comments
Labels

Comments

@SeanHayes
Copy link

I have a scope that was recorded with nock.bak that looks like this:

{
    "scope": "https://api.example.com:443",
    "method": "GET",
    "path": "/mypath?platform=web&key=JJHDC7UK73EH",
    "body": "",
    "status": 200,
    "response": {
        "anonid": "Mjk2MjEyMDc5"
    },
    "rawHeaders": [
        "Access-Control-Allow-Origin",
        "*",
        "Content-Type",
        "application/json",
        "Date",
        "Wed, 07 Mar 2018 09:50:09 GMT",
        "Server",
        "nginx/1.12.2",
        "Set-Cookie",
        "scookie=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT",
        "X-Redux-Status",
        "ZOOL",
        "Content-Length",
        "30",
        "Connection",
        "Close"
    ]
},

That response may have originally been 30 bytes long, but I suspect that since it's stored as an inline data structure, nock will serialize it without the original pretty printing.

Is there a way to force nock to always store the original request?

@gr2m
Copy link
Member

gr2m commented Mar 7, 2018

Hmm could you please create a PR with a failing pull request? That will help us investigate the issue

SeanHayes added a commit to SeanHayes/nock that referenced this issue Mar 8, 2018
SeanHayes added a commit to SeanHayes/nock that referenced this issue Mar 8, 2018
SeanHayes added a commit to SeanHayes/nock that referenced this issue Mar 8, 2018
SeanHayes added a commit to SeanHayes/nock that referenced this issue Mar 8, 2018
@SeanHayes
Copy link
Author

I added PR #1095

@stale
Copy link

stale bot commented Sep 14, 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. We try to do our best, but nock is maintained by volunteers and there is only so much we can do at a time. Thank you for your contributions.

@stale stale bot added the stale label Sep 14, 2018
@stale stale bot closed this as completed Sep 21, 2018
@lock
Copy link

lock bot commented Oct 5, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you!

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

No branches or pull requests

2 participants