Closed stncrn closed 3 years ago
Thanks for catching this, you are totally right. We need deep copy for headers at least.
Please try the latest master, it should solve the issue.
Great! Thanks for the fix.
I sadly am quite busy at the moment, and won't be able to try soon.
(I used a quick and dirty workaround for the only header I was manipulating, as I was quite in a hurry)
But yes, the commit seems ok.
No problem, I'll close the issue, feel free to reopen again.
Hello,
I have found a small issue with the request.create() function.
Let's start with an example:
Basically, just a broadcasting backend, sending an incoming request to several servers. If the incoming request contains a 'my-custom-header' header, the customization in my loop will remove it for the call to the 1st backend. But the header should still be there for the call to the 2nd server.
Seems that the faulty lines are these ones in the http module:
url
anddata
are properly copied, as they're strings. But for the 3 tables (headers
,params
andauth
), only the reference of the first request is copied.Each further edit is therefore targeting the original request, as well as its copy.
Using a proper object copy function should do the trick: Haven't tried it myself for the moment : http://lua-users.org/wiki/CopyTable