hyperlog-android icon indicating copy to clipboard operation
hyperlog-android copied to clipboard

Is the Boundary headers right?

Open rsbala opened this issue 6 years ago • 5 comments

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.

rsbala avatar Mar 06 '18 18:03 rsbala

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

endeepak avatar Mar 22 '18 03:03 endeepak

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

Anurag--Singh avatar Jul 03 '18 05:07 Anurag--Singh

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

endeepak avatar Jul 06 '18 13:07 endeepak

@endeepak Thank-you.

Anurag--Singh avatar Jul 07 '18 06:07 Anurag--Singh

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.

aflames avatar Jul 12 '18 10:07 aflames