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

Disjoint request intervals prevents CSV-formatted responses from returning correctly #71

Closed
cdeszaq opened this issue Oct 19, 2016 · 7 comments
Labels

Comments

@cdeszaq
Copy link
Collaborator

cdeszaq commented Oct 19, 2016

I've not dug into it, but requests with multiple disjoint intervals specified (like 2016-10-08/2016-10-09,2016-10-11/2016-10-12) and a CSV formatted response (ie. format=csv) cause Fili's response to be unfriendly to browsers.

I've not tried it in a non-browser environment like curl yet, but I wanted to raise a flag so that others are aware of the problem. I think @mangesh-pardeshi ran into the issue first, and so he may be looking into it, but I'm not sure.

@cdeszaq cdeszaq added the BUG label Oct 19, 2016
@mangesh-pardeshi
Copy link
Contributor

Yes, I ran into this issue and will look in to it. Currently working on #72

@mangesh-pardeshi
Copy link
Contributor

works fine with curl

@cdeszaq
Copy link
Collaborator Author

cdeszaq commented Oct 20, 2016

@mangesh-pardeshi what does curl give as raw output? (ie. curl -vv to show all the headers, etc.) My guess is that there's a mismatch between the Content-Type header and what we're sending in the response (possibly)

@mangesh-pardeshi
Copy link
Contributor

GET /v1/data/network/all/?dateTime=2016-10-08/2016-10-09,2016-10-11/2016-10-12&metrics=dayAvgUniqueIdentifier&format=csv HTTP/1.1
< HTTP/1.1 200 OK
< Content-Type: text/csv; charset=utf-8
< Content-Disposition: attachment; filename=data-network-all-_2016-10-08_2016-10-09,2016-10-11_2016-10-12.csv
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: *
< Access-Control-Allow-Credentials: true
< Content-Length: 104

Browser request generates NPL. Looking into it

@mangesh-pardeshi
Copy link
Contributor

Surprisingly it also fails using Postman when I am explicitly passing Content-type=text/csv and Accept=/

@cdeszaq
Copy link
Collaborator Author

cdeszaq commented Oct 21, 2016

Based on the verbose curl output, it looks like only the response headers are getting sent, and the csv response body is failing to send. The Content-Length of only 104 bytes is very suspicious. Given that, I'm not surprised clients get upset, since they are not getting any actual content back.

I'm guessing there'll be dumps in the logs from something failing to build the csv body. We just are not seeing the failure in the response because the headers are already sent.

@cdeszaq
Copy link
Collaborator Author

cdeszaq commented Oct 24, 2016

Fixed by #76

@cdeszaq cdeszaq closed this as completed Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants