-
Notifications
You must be signed in to change notification settings - Fork 1.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
Client closed connection before receiving entire response #820
Comments
if you forked that repo:
Then start the tests:
You should get:
Charles is telling: URL: http://mercury.itv.com/api/json/dotcom/programme/searchatoz/a The response is kind of stopped in the middle (see the failure message) so I thought about PhantomJS. I also noticed that I can't reach this API from something else than localhost but I haven't been able to run Karma on the port 80. This might not be an issue but rather a strange behavior of the API that shows part of the request while it shouldn't if there was CORS issue. Is there anything specific to do to reach external API with Karma usually? Romu |
How big is the JSON file? It might be related to the gzip problem, can you try hack your Karma: Put there some Karma listens on configured port (9876 by default) on all interfaces, so you should be able to access Karma from everywhere where you can access the machine where Karma is running. You can totally run Karma on port 80, but you will probably have to start it with sudo, as 80 port is reserved. Try to fetch the file through |
@soundstep did you try it? |
I can't really remove this line, it is creating some errors I think. The JSON is really a file but coming from API external which only allow the domain "localhost". I think that is the problem. It is just weird that I receive part of the file instead of getting a 401 or something. The error removing the line 55 was:
|
Sorry I think the line number might have gotten confused, here's a link to specific tag: Do exactly this 5ee886b |
I see. It doesn't solve the problem but it is not directly related to karma. It is good to know though, thanks for that |
@soundstep I'm confused what are you talking about? Is this JSON file served by Karma ? Did you try disabling the gzip? |
No the file is not served by Karma, I gave the URL above. I found that localhost:80 only is allowed, hence the error. And I've been mislead as even though unauthorized, I get part of the response (json). So the issue is probably not in Karma as I suppose it is serving a specific port (not allowed by the remote server): localhost:KARMA_PORT Sorry about the confusion, the ticket can probably be closed. |
Testing a service that does a jsonp request (using reqwest).
I've got the same mocha + chai tests running well in the browser but I got an error in Karma + PhantomJS: a timeout on the request.
Charles is telling me that the request was closed:
"Client closed connection before receiving entire response"
And indeed the json is cut in the middle.
Not that the url of the request is coming from an external API.
I'll post a repo later today so you can fork and run the tests.
Cheers.
The text was updated successfully, but these errors were encountered: