Roxen.git
/
server
/
etc
/
modules
/
Roxen.pmod
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/etc/modules/Roxen.pmod:1425:
//! use in the response. It's @[Protocols.HTTP.HTTP_FOUND] (i.e. 302) //! by default. { // If we don't get any URL we don't know what to do. // But we do! /per if(!url) url = ""; url = make_absolute_url (url, id, prestates, variables);
+
url = http_encode_invalids(url);
+
HTTP_WERR("Redirect -> "+url); return http_status( http_code || Protocols.HTTP.HTTP_FOUND, "Redirect to " + html_encode_string(url)) + ([ "extra_heads":([ "Location":url ]) ]); } mapping http_stream(Stdio.File from) //! Returns a result mapping where the data returned to the client //! will be streamed raw from the given Stdio.File object, instead of
Roxen.git/server/etc/modules/Roxen.pmod:3815:
// Low-level C-roxen optimization functions. inherit _Roxen; // This symbol is added by roxenloader if an old _Roxen.make_http_headers() // is detected. #if constant(HAVE_OLD__Roxen_make_http_headers) string make_http_headers(mapping(string:string|array(string)) heads, int(0..1)|void no_terminator) {
-
string
res
= ::make_http_headers
(
heads
)
;
-
if (
no
_
terminator
)
{
-
//
Remove
the
terminating
CRLF.
-
return
res[..sizeof
(
res
)
-3]
;
+
foreach(heads;
string
key;
string|array
(
string
)
val) {
+
if (
has
_
value(key, "\n"
)
|| has_value(key, "\r") ||
+
has_value(key, ":") || has_value(key, " ") || has_value(key, "\t")) {
+
error
(
"Invalid headername: %O (value: %O
)
\n", key, val)
;
}
-
return
res
;
+
if (stringp(val) && (has_value(val, "\n") || has_value(val, "\r"))) {
+
error("Invalid value for header %O: %O\n", key, val)
;
}
-
+
if (arrayp(val)) {
+
foreach(val, string v) {
+
if (has_value(v, "\n") || has_value(v, "\r")) {
+
error("Invalid value for header %O: %O\n", key, val);
+
}
+
}
+
}
+
}
+
return ::make_http_headers(heads, no_terminator);
+
}
#endif /* constant(HAVE_OLD__Roxen_make_http_headers) */ /* * TODO: * * o Quota: Fix support for the index file. * */ #ifdef QUOTA_DEBUG