git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/branches/REL_2@3307
cb58f699-b61c-0410-a6fe-
9272a202ed29
</choice>
<element ref="ds:Signature" minOccurs="0"/>
</sequence>
</choice>
<element ref="ds:Signature" minOccurs="0"/>
</sequence>
+ <attribute name="unicodeAware" type="boolean"/>
<attributeGroup ref="conf:ContentSettings"/>
</complexType>
</element>
<attributeGroup ref="conf:ContentSettings"/>
</complexType>
</element>
class Override : public DOMPropertySet, public DOMNodeFilter
{
public:
class Override : public DOMPropertySet, public DOMNodeFilter
{
public:
- Override() : m_acl(nullptr) {}
- Override(const DOMElement* e, Category& log, const Override* base=nullptr);
+ Override(bool unicodeAware=false) : m_unicodeAware(unicodeAware), m_acl(nullptr) {}
+ Override(bool unicodeAware, const DOMElement* e, Category& log, const Override* base=nullptr);
~Override();
// Provides filter to exclude special config elements.
~Override();
// Provides filter to exclude special config elements.
protected:
void loadACL(const DOMElement* e, Category& log);
protected:
void loadACL(const DOMElement* e, Category& log);
map<string,Override*> m_map;
vector< pair<RegularExpression*,Override*> > m_regexps;
vector< pair< pair<string,RegularExpression*>,Override*> > m_queries;
map<string,Override*> m_map;
vector< pair<RegularExpression*,Override*> > m_regexps;
vector< pair< pair<string,RegularExpression*>,Override*> > m_queries;
-Override::Override(const DOMElement* e, Category& log, const Override* base) : m_acl(nullptr)
+Override::Override(bool unicodeAware, const DOMElement* e, Category& log, const Override* base)
+ : m_unicodeAware(unicodeAware), m_acl(nullptr)
{
try {
// Load the property set.
{
try {
// Load the property set.
- Override* o=new Override(path,log,this);
- pair<bool,const char*> name=o->getString("name");
- char* dup=strdup(name.second);
- for (char* pch=dup; *pch; pch++)
- *pch=tolower(*pch);
+ char* dup = nullptr;
+ Override* o = new Override(m_unicodeAware, path, log, this);
+ if (m_unicodeAware) {
+ dup = toUTF8(o->getXMLString("name").second, true /* use malloc */);
+ }
+ else {
+ dup = strdup(o->getString("name").second);
+ for (char* pch = dup; *pch; ++pch)
+ *pch = tolower(*pch);
+ }
if (m_map.count(dup)) {
log.warn("skipping duplicate Path element (%s)",dup);
free(dup);
delete o;
continue;
}
if (m_map.count(dup)) {
log.warn("skipping duplicate Path element (%s)",dup);
free(dup);
delete o;
continue;
}
log.debug("added Path mapping (%s)", dup);
free(dup);
}
log.debug("added Path mapping (%s)", dup);
free(dup);
}
- auto_ptr<Override> o(new Override(path,log,this));
+ auto_ptr<Override> o(new Override(m_unicodeAware, path, log, this));
const XMLCh* flag=path->getAttributeNS(nullptr,ignoreCase);
try {
const XMLCh* flag=path->getAttributeNS(nullptr,ignoreCase);
try {
auto_ptr_char ntemp(n);
const XMLCh* v=path->getAttributeNS(nullptr,regex);
auto_ptr_char ntemp(n);
const XMLCh* v=path->getAttributeNS(nullptr,regex);
- auto_ptr<Override> o(new Override(path,log,this));
+ auto_ptr<Override> o(new Override(m_unicodeAware, path, log, this));
try {
RegularExpression* re = nullptr;
if (v && *v)
try {
RegularExpression* re = nullptr;
if (v && *v)
if (*path == '/')
path++;
if (*path == '/')
path++;
- // Now we copy the path, chop the query string, and lower case it.
+ // Now we copy the path, chop the query string, and possibly lower case it.
char* dup=strdup(path);
char* sep=strchr(dup,'?');
if (sep)
*sep=0;
char* dup=strdup(path);
char* sep=strchr(dup,'?');
if (sep)
*sep=0;
- for (char* pch=dup; *pch; pch++)
- *pch=tolower(*pch);
+ if (!m_unicodeAware) {
+ for (char* pch=dup; *pch; pch++)
+ *pch=tolower(*pch);
+ }
// Default is for the current object to provide settings.
const Override* o=this;
// Default is for the current object to provide settings.
const Override* o=this;
#ifdef _DEBUG
xmltooling::NDC ndc("XMLRequestMapperImpl");
#endif
#ifdef _DEBUG
xmltooling::NDC ndc("XMLRequestMapperImpl");
#endif
- static const XMLCh _default[] = UNICODE_LITERAL_7(d,e,f,a,u,l,t);
- static const XMLCh _id[] = UNICODE_LITERAL_2(i,d);
- static const XMLCh _RequestMap[] = UNICODE_LITERAL_10(R,e,q,u,e,s,t,M,a,p);
+ static const XMLCh _default[] = UNICODE_LITERAL_7(d,e,f,a,u,l,t);
+ static const XMLCh _id[] = UNICODE_LITERAL_2(i,d);
+ static const XMLCh _RequestMap[] = UNICODE_LITERAL_10(R,e,q,u,e,s,t,M,a,p);
if (!XMLHelper::isNodeNamed(e, SHIB2SPCONFIG_NS, _RequestMap))
throw ConfigurationException("XML RequestMapper requires conf:RequestMap at root of configuration.");
if (!XMLHelper::isNodeNamed(e, SHIB2SPCONFIG_NS, _RequestMap))
throw ConfigurationException("XML RequestMapper requires conf:RequestMap at root of configuration.");
// Load any AccessControl provider.
loadACL(e,log);
// Load any AccessControl provider.
loadACL(e,log);
+ pair<bool,bool> unicodeAware = getBool("unicodeAware");
+ m_unicodeAware = (unicodeAware.first && unicodeAware.second);
+
// Loop over the HostRegex elements.
const DOMElement* host = XMLHelper::getFirstChildElement(e,HostRegex);
for (int i=1; host; ++i, host=XMLHelper::getNextSiblingElement(host,HostRegex)) {
// Loop over the HostRegex elements.
const DOMElement* host = XMLHelper::getFirstChildElement(e,HostRegex);
for (int i=1; host; ++i, host=XMLHelper::getNextSiblingElement(host,HostRegex)) {
- auto_ptr<Override> o(new Override(host,log,this));
+ auto_ptr<Override> o(new Override(m_unicodeAware, host, log, this));
const XMLCh* flag=host->getAttributeNS(nullptr,ignoreCase);
try {
const XMLCh* flag=host->getAttributeNS(nullptr,ignoreCase);
try {
- Override* o=new Override(host,log,this);
+ Override* o=new Override(m_unicodeAware, host, log, this);
pair<bool,const char*> name=o->getString("name");
pair<bool,const char*> scheme=o->getString("scheme");
pair<bool,const char*> port=o->getString("port");
pair<bool,const char*> name=o->getString("name");
pair<bool,const char*> scheme=o->getString("scheme");
pair<bool,const char*> port=o->getString("port");