Closed jcoetzee closed 4 years ago
When you provide a headers object to new_from_uri
you should provide one with :authority
:path
and :scheme
pseudo header fields.
Perhaps this can be improved on if it can be lightweight enough.
Okay, I see. Looking at the code now I see that the values are upserted, so it would be sufficient to supply placeholder headers for these fields that will be replaced during the call?
I'm guessing that the problem lies with upserting appending if header doesn't exist.
Okay, I see. Looking at the code now I see that the values are upserted, so it would be sufficient to supply placeholder headers for these fields that will be replaced during the call?
I'm guessing that the problem lies with upserting appending if header doesn't exist.
yep. though I'm undecided if that's intentional behaviour or not.... The whole "pass a own header object" API is undocumented because I didn't want to commit to some of these decisions.
You're better off using new_from_uri
with just a uri and then using :upsert
afterwards.
Ah, yes. That way is better. Thanks, working now.
I get an error whenever I try specify headers to be used in
new_from_uri()
local headers, stream = assert(http_request.new_from_uri(self.url, gz_headers):go(20 * second))
Error:
The way I understand I am specifying pseudo-header fields before regular header fields?