Is there any way to have optional headers?
Created by: vladfedin
Amazon AWS requests can utilize a lot of different headers to modify the request (even with custom header name - to set user metadata on content) and I had to add additional subtable to request. So we got something like
res = aws:put_bucket {
aws_parameters = {
headers = {
{'x-amz-acl'; 'public-read';};
{'X-Amz-Meta-ChecksumAlgorithm'; 'crc32';};
{'X-Amz-Meta-FileChecksum'; '0x02661779';};
{'X-Amz-Meta-ReviewedBy'; 'jane@johnsmith.net, joe@johnsmith.net';};
{'X-Amz-Meta-randomuserdefinedname'; 'randomuserdefinedvalue';};
};
...
};
}
So aws_parameters.headers is parsed in AWS authentication middleware module and added to request.headers without checking. This is definitely a hack. Is it even close to good solution or may be i've completely missed some point in code and this can be done by other, more regular Spore means?