Closed Swagova closed 6 years ago
post data? it's a text-based data format? maybe you should base64 data before send it via post?
Google sends a bid request as a serialized protocol buffer attached as the binary payload of an HTTP POST request. While we are decoding that bid request we are getting above error.
So maybe you should use Content-Length to receive all bytes of the binary payload? you can try it out, or use payload binary make a minimalized failure test for me.
I can confirm this. I have attached a simple example that trying to load the .proto file and decode data in PB format. The data exists in a separate file and can be successfully decoded using other libraries.
I just find out the reason. because your proto file 771 line set billing_id as not packed, but in proton.Lua
any value in packed will treated as "true" :-( my bad.
just pushed a new version you could try it out, any feedbacks are welcome :-)
That did the trick. Thanks for the quick resolution and the package itself.
Hi, We are trying to decode google rtb requester post data. But it is giving "unfinished bytes" error. Our .proto file : https://developers.google.com/ad-exchange/rtb/downloads/realtime-bidding-proto.txt Here is the code we are using
local bid_request = assert(pb.decode("BidRequest", ngx.req.get_body_data()))
Can you help me with this.