hyperlog-android
hyperlog-android copied to clipboard
Is the Boundary headers right?
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.
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
When I post gzip file using command curl -XPOST <url> -F "file=@/tmp/device-logs.txt.gz"
, the request body looks like
RFC Reference: https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
@endeepak, @rsbala Did you happen to find any alternate solution?
@Anurag--Singh We started using HyperLog.getDeviceLogs(boolean deleteLogs, int batchNo);
to push logs in JSON format to our log aggregation service
@endeepak Thank-you.
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.