- this.channel.owner = systemPrincipal;
-
- let stream = services.InputStream(channelStream);
- let [, pre, doctype, url, extra, open, post] = util.regexp(<![CDATA[
- ^ ([^]*?)
- (?:
- (<!DOCTYPE \s+ \S+ \s+) (?:SYSTEM \s+ "([^"]*)" | ((?:[^[>\s]|\s[^[])*))
- (\s+ \[)?
- ([^]*)
- )?
- $
- ]]>, "x").exec(stream.read(4096));
- this.writes.push(pre);
- if (doctype) {
- this.writes.push(doctype + (extra || "") + " [\n");
- if (url)
- this.addChannel(url);
-
- if (!open)
- this.writes.push("\n]");
-
- for (let [, pre, url] in util.regexp.iterate(/([^]*?)(?:%include\s+"([^"]*)";|$)/gy, post)) {
- this.writes.push(pre);
+ this.channel.owner = systemPrincipal;
+
+ let type = this.channel.contentType;
+ if (/^text\/|[\/+]xml$/.test(type)) {
+ let stream = services.InputStream(channelStream);
+ let [, pre, doctype, url, extra, open, post] = util.regexp(literal(/*
+ ^ ([^]*?)
+ (?:
+ (<!DOCTYPE \s+ \S+ \s+) (?:SYSTEM \s+ "([^"]*)" | ((?:[^[>\s]|\s[^[])*))
+ (\s+ \[)?
+ ([^]*)
+ )?
+ $
+ */), "x").exec(stream.read(4096));
+ this.writes.push(pre);
+ if (doctype) {
+ this.writes.push(doctype + (extra || "") + " [\n");