53 |
|
cse::String path(env.get(_B("PATH_TRANSLATED"))); |
54 |
|
api::Pcre::RegEx script(_S<ios::String>() << _B("^") << env.get(_B("SCRIPT_NAME"))); |
55 |
|
|
56 |
< |
if (!path.IsEmpty() && script(env.get(_B("REQUEST_URI")))) |
56 |
> |
if (!path.IsEmpty() && !script(env.get(_B("REQUEST_URI")))) |
57 |
|
{ |
58 |
|
try |
59 |
|
{ |
112 |
|
args.InsertLast(path); |
113 |
|
|
114 |
|
_S<api::Process> xslt(program, args); |
115 |
+ |
ext::Buffer line; |
116 |
+ |
api::Pcre::RegEx content("http-equiv=\"Content-Type\" content=\"(.*)\""); |
117 |
|
_S<ios::String> output; |
118 |
+ |
cse::String type(_B("text/xml")); |
119 |
|
|
120 |
< |
ios::ReadToWrite(*xslt.GetReader(), output); |
118 |
< |
|
119 |
< |
if (!output.IsEmpty()) |
120 |
> |
while (ios::ReadLine(*xslt.GetReader(), line)) |
121 |
|
{ |
122 |
< |
cse::String type(_B("text/xml")); |
122 |
< |
api::Pcre::RegEx content("http-equiv=\"Content-Type\" content=\"(.*)\""); |
122 |
> |
output << line << ios::NewLine; |
123 |
|
|
124 |
|
if (api::Pcre::RegEx::Match match = content(output)) |
125 |
+ |
{ |
126 |
|
type = match[1]; |
127 |
|
|
128 |
< |
api::Cout << "Content-Type: " << type << "\r\n\r\n" << output; |
128 |
> |
break; |
129 |
> |
} |
130 |
|
} |
131 |
+ |
|
132 |
+ |
ios::ReadToWrite(*xslt.GetReader(), output); |
133 |
+ |
|
134 |
+ |
if (!output.IsEmpty()) |
135 |
+ |
api::Cout << "Content-Type: " << type << "\r\n\r\n" << output; |
136 |
|
else |
137 |
|
pass(path); |
138 |
|
} |