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

Is the Boundary headers right? #9

Open
rsbala opened this issue Mar 6, 2018 · 5 comments
Open

Is the Boundary headers right? #9

rsbala opened this issue Mar 6, 2018 · 5 comments

Comments

@rsbala
Copy link

rsbala commented Mar 6, 2018

Thanks for the great library.

We are moving away from our custom remote logger to hyperlog. Our old backend was not able to support the new request of hyperlog.
One thing we observed was the boundary mismatch.
In headers we observed
('Content-Type', 'multipart/form-data;boundary=HyperLog -1520361605154') which was coming from the java code
private final String boundary = "HyperLog -" + System.currentTimeMillis();

But the request's body didn't have the timeinmillis part in the boundary.
'--HyperLog\r\nContent-Disposition: form-data; name="<ngx_upload_module_dummy>"\r\n\r\n\r\n--HyperLog--\r\n'
We got the error line as
Invalid multipart/form-data: no final boundary

We wanted to cross check with you guys whether there is any issue from the library.

@endeepak
Copy link

endeepak commented Mar 22, 2018

I've observed same in 0.0.9 version. The request made by HyperLog.pushLogs doesn't seem to have the boundary

Following is the content sent by HyperLog.pushLogs. Content-Disposition and boundary is missing in the body

image

When I post gzip file using command curl -XPOST <url> -F "file=@/tmp/device-logs.txt.gz", the request body looks like

image

RFC Reference: https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html

@Anurag--Singh
Copy link

@endeepak, @rsbala Did you happen to find any alternate solution?

@endeepak
Copy link

endeepak commented Jul 6, 2018

@Anurag--Singh We started using HyperLog.getDeviceLogs(boolean deleteLogs, int batchNo); to push logs in JSON format to our log aggregation service

@Anurag--Singh
Copy link

@endeepak Thank-you.

@aflames
Copy link

aflames commented Jul 12, 2018

I have the same the problem, are you going to resolve this?

We observe that the file content is not coming in the request:
Content-Disposition: form-data;filename="device_log.txt"

and searching how the file has to be uploaded with Volley we have seen this:
Content-Disposition: form-data; name="file";filename="device_log.txt"

We do not know if this is the problem but we do not get the file in our server.

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants