mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-20 03:05:12 +00:00
Merge pull request #410 from ggtakec/master
Allow duplicate key in ahbe_conf - #386
This commit is contained in:
commit
fe253c3d22
@ -193,6 +193,10 @@ bool AdditionalHeader::AddHeader(headers_t& meta, const char* path) const
|
|||||||
size_t pathlength = strlen(path);
|
size_t pathlength = strlen(path);
|
||||||
|
|
||||||
// loop
|
// loop
|
||||||
|
//
|
||||||
|
// [NOTE]
|
||||||
|
// Because to allow duplicate key, and then scanning the entire table.
|
||||||
|
//
|
||||||
for(addheadlist_t::const_iterator iter = addheadlist.begin(); iter != addheadlist.end(); ++iter){
|
for(addheadlist_t::const_iterator iter = addheadlist.begin(); iter != addheadlist.end(); ++iter){
|
||||||
const PADDHEAD paddhead = *iter;
|
const PADDHEAD paddhead = *iter;
|
||||||
if(!paddhead){
|
if(!paddhead){
|
||||||
@ -205,7 +209,6 @@ bool AdditionalHeader::AddHeader(headers_t& meta, const char* path) const
|
|||||||
if(0 == regexec(paddhead->pregex, path, 1, &match, 0)){
|
if(0 == regexec(paddhead->pregex, path, 1, &match, 0)){
|
||||||
// match -> adding header
|
// match -> adding header
|
||||||
meta[paddhead->headkey] = paddhead->headvalue;
|
meta[paddhead->headkey] = paddhead->headvalue;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
// directly comparing
|
// directly comparing
|
||||||
@ -213,7 +216,6 @@ bool AdditionalHeader::AddHeader(headers_t& meta, const char* path) const
|
|||||||
if(0 == paddhead->basestring.length() || 0 == strcmp(&path[pathlength - paddhead->basestring.length()], paddhead->basestring.c_str())){
|
if(0 == paddhead->basestring.length() || 0 == strcmp(&path[pathlength - paddhead->basestring.length()], paddhead->basestring.c_str())){
|
||||||
// match -> adding header
|
// match -> adding header
|
||||||
meta[paddhead->headkey] = paddhead->headvalue;
|
meta[paddhead->headkey] = paddhead->headvalue;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user