author | wenzelm |
Tue, 05 Nov 2024 22:05:50 +0100 | |
changeset 81350 | 1818358373e2 |
parent 80368 | 9db395953106 |
child 81781 | 10669f47f6fd |
permissions | -rw-r--r-- |
65077 | 1 |
/* Title: Pure/General/http.scala |
63823 | 2 |
Author: Makarius |
3 |
||
73438 | 4 |
HTTP client and server support. |
63823 | 5 |
*/ |
6 |
||
7 |
package isabelle |
|
8 |
||
9 |
||
73417 | 10 |
import java.io.{File => JFile} |
75104 | 11 |
import java.nio.file.Files |
79658 | 12 |
import java.net.{InetSocketAddress, URI, HttpURLConnection} |
80243
b2889dd54a2a
use Content-Digest header in HEAD requests instead of length (to track non-monotone changes);
Fabian Huch <huch@in.tum.de>
parents:
80202
diff
changeset
|
13 |
import java.util.HexFormat |
63823 | 14 |
import com.sun.net.httpserver.{HttpExchange, HttpHandler, HttpServer} |
15 |
||
16 |
||
75393 | 17 |
object HTTP { |
73416
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
18 |
/** content **/ |
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
19 |
|
75393 | 20 |
object Content { |
75106 | 21 |
val mime_type_bytes: String = "application/octet-stream" |
22 |
val mime_type_text: String = "text/plain; charset=utf-8" |
|
23 |
val mime_type_html: String = "text/html; charset=utf-8" |
|
73417 | 24 |
|
75106 | 25 |
val default_mime_type: String = mime_type_bytes |
76356 | 26 |
val default_encoding: String = UTF8.charset.name |
75106 | 27 |
|
28 |
def apply( |
|
29 |
bytes: Bytes, |
|
30 |
file_name: String = "", |
|
31 |
mime_type: String = default_mime_type, |
|
32 |
encoding: String = default_encoding, |
|
33 |
elapsed_time: Time = Time.zero): Content = |
|
34 |
new Content(bytes, file_name, mime_type, encoding, elapsed_time) |
|
73416
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
35 |
|
75393 | 36 |
def read(file: JFile): Content = { |
75106 | 37 |
val bytes = Bytes.read(file) |
38 |
val file_name = file.getName |
|
39 |
val mime_type = Option(Files.probeContentType(file.toPath)).getOrElse(default_mime_type) |
|
40 |
apply(bytes, file_name = file_name, mime_type = mime_type) |
|
41 |
} |
|
42 |
||
43 |
def read(path: Path): Content = read(path.file) |
|
44 |
} |
|
45 |
||
46 |
class Content private( |
|
47 |
val bytes: Bytes, |
|
48 |
val file_name: String, |
|
49 |
val mime_type: String, |
|
50 |
val encoding: String, |
|
75393 | 51 |
val elapsed_time: Time |
52 |
) { |
|
80368 | 53 |
def text: String = new String(bytes.make_array, encoding) |
74945 | 54 |
def json: JSON.T = JSON.parse(text) |
73416
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
55 |
} |
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
56 |
|
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
57 |
|
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
58 |
|
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
59 |
/** client **/ |
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
60 |
|
73417 | 61 |
val NEWLINE: String = "\r\n" |
62 |
||
75393 | 63 |
object Client { |
73439 | 64 |
val default_timeout: Time = Time.seconds(180) |
73422 | 65 |
|
75393 | 66 |
def open_connection( |
79510
d8330439823a
clarified signature: explicit type isabelle.Url to avoid oddities of java.net.URL (e.g. its "equals" method);
wenzelm
parents:
78768
diff
changeset
|
67 |
url: Url, |
73422 | 68 |
timeout: Time = default_timeout, |
75393 | 69 |
user_agent: String = "" |
70 |
): HttpURLConnection = { |
|
79510
d8330439823a
clarified signature: explicit type isabelle.Url to avoid oddities of java.net.URL (e.g. its "equals" method);
wenzelm
parents:
78768
diff
changeset
|
71 |
url.open_connection() match { |
73421 | 72 |
case connection: HttpURLConnection => |
78243 | 73 |
if (0 < timeout.ms && timeout.ms <= Int.MaxValue) { |
73422 | 74 |
val ms = timeout.ms.toInt |
75 |
connection.setConnectTimeout(ms) |
|
76 |
connection.setReadTimeout(ms) |
|
77 |
} |
|
73421 | 78 |
proper_string(user_agent).foreach(s => connection.setRequestProperty("User-Agent", s)) |
79 |
connection |
|
80 |
case _ => error("Bad URL (not HTTP): " + quote(url.toString)) |
|
81 |
} |
|
82 |
} |
|
73417 | 83 |
|
75393 | 84 |
def get_content(connection: HttpURLConnection): Content = { |
73417 | 85 |
val Charset = """.*\bcharset="?([\S^"]+)"?.*""".r |
73429
8970081c6500
elapsed time to download content (and for the server to provide content);
wenzelm
parents:
73425
diff
changeset
|
86 |
|
8970081c6500
elapsed time to download content (and for the server to provide content);
wenzelm
parents:
73425
diff
changeset
|
87 |
val start = Time.now() |
75394 | 88 |
using(connection.getInputStream) { stream => |
73417 | 89 |
val bytes = Bytes.read_stream(stream, hint = connection.getContentLength) |
73429
8970081c6500
elapsed time to download content (and for the server to provide content);
wenzelm
parents:
73425
diff
changeset
|
90 |
val stop = Time.now() |
8970081c6500
elapsed time to download content (and for the server to provide content);
wenzelm
parents:
73425
diff
changeset
|
91 |
|
79510
d8330439823a
clarified signature: explicit type isabelle.Url to avoid oddities of java.net.URL (e.g. its "equals" method);
wenzelm
parents:
78768
diff
changeset
|
92 |
val file_name = Url.file_name(Url(connection.getURL.toURI)) |
75106 | 93 |
val mime_type = Option(connection.getContentType).getOrElse(Content.default_mime_type) |
73417 | 94 |
val encoding = |
95 |
(connection.getContentEncoding, mime_type) match { |
|
96 |
case (enc, _) if enc != null => enc |
|
97 |
case (_, Charset(enc)) => enc |
|
75106 | 98 |
case _ => Content.default_encoding |
73417 | 99 |
} |
73429
8970081c6500
elapsed time to download content (and for the server to provide content);
wenzelm
parents:
73425
diff
changeset
|
100 |
Content(bytes, file_name = file_name, mime_type = mime_type, |
8970081c6500
elapsed time to download content (and for the server to provide content);
wenzelm
parents:
73425
diff
changeset
|
101 |
encoding = encoding, elapsed_time = stop - start) |
75394 | 102 |
} |
73417 | 103 |
} |
104 |
||
79510
d8330439823a
clarified signature: explicit type isabelle.Url to avoid oddities of java.net.URL (e.g. its "equals" method);
wenzelm
parents:
78768
diff
changeset
|
105 |
def get(url: Url, timeout: Time = default_timeout, user_agent: String = ""): Content = |
73422 | 106 |
get_content(open_connection(url, timeout = timeout, user_agent = user_agent)) |
73417 | 107 |
|
75393 | 108 |
def post( |
79510
d8330439823a
clarified signature: explicit type isabelle.Url to avoid oddities of java.net.URL (e.g. its "equals" method);
wenzelm
parents:
78768
diff
changeset
|
109 |
url: Url, |
75393 | 110 |
parameters: List[(String, Any)], |
73422 | 111 |
timeout: Time = default_timeout, |
75393 | 112 |
user_agent: String = "" |
113 |
): Content = { |
|
73422 | 114 |
val connection = open_connection(url, timeout = timeout, user_agent = user_agent) |
73421 | 115 |
connection.setRequestMethod("POST") |
116 |
connection.setDoOutput(true) |
|
73417 | 117 |
|
79717 | 118 |
val boundary = UUID.random_string() |
73421 | 119 |
connection.setRequestProperty( |
120 |
"Content-Type", "multipart/form-data; boundary=" + quote(boundary)) |
|
73417 | 121 |
|
75394 | 122 |
using(connection.getOutputStream) { out => |
73421 | 123 |
def output(s: String): Unit = out.write(UTF8.bytes(s)) |
124 |
def output_newline(n: Int = 1): Unit = (1 to n).foreach(_ => output(NEWLINE)) |
|
125 |
def output_boundary(end: Boolean = false): Unit = |
|
126 |
output("--" + boundary + (if (end) "--" else "") + NEWLINE) |
|
127 |
def output_name(name: String): Unit = |
|
128 |
output("Content-Disposition: form-data; name=" + quote(name)) |
|
75393 | 129 |
def output_value(value: Any): Unit = { |
73421 | 130 |
output_newline(2) |
131 |
output(value.toString) |
|
132 |
} |
|
75393 | 133 |
def output_content(content: Content): Unit = { |
73421 | 134 |
proper_string(content.file_name).foreach(s => output("; filename=" + quote(s))) |
135 |
output_newline() |
|
136 |
proper_string(content.mime_type).foreach(s => output("Content-Type: " + s)) |
|
137 |
output_newline(2) |
|
138 |
content.bytes.write_stream(out) |
|
139 |
} |
|
73417 | 140 |
|
73421 | 141 |
output_newline(2) |
73417 | 142 |
|
73421 | 143 |
for { (name, value) <- parameters } { |
144 |
output_boundary() |
|
145 |
output_name(name) |
|
146 |
value match { |
|
147 |
case content: Content => output_content(content) |
|
75106 | 148 |
case file: JFile => output_content(Content.read(file)) |
149 |
case path: Path => output_content(Content.read(path)) |
|
73421 | 150 |
case _ => output_value(value) |
151 |
} |
|
152 |
output_newline() |
|
153 |
} |
|
154 |
output_boundary(end = true) |
|
155 |
out.flush() |
|
75394 | 156 |
} |
73417 | 157 |
|
73421 | 158 |
get_content(connection) |
73416
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
159 |
} |
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
160 |
} |
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
161 |
|
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
162 |
|
08aa4c1ed579
clarified signature: more explicit HTTP operations;
wenzelm
parents:
73413
diff
changeset
|
163 |
|
65081 | 164 |
/** server **/ |
165 |
||
75107 | 166 |
/* request */ |
167 |
||
75108 | 168 |
def url_path(names: String*): String = |
169 |
names.iterator.flatMap(a => if (a.isEmpty) None else Some("/" + a)).mkString |
|
170 |
||
171 |
class Request private[HTTP]( |
|
75146 | 172 |
val server_name: String, |
173 |
val service_name: String, |
|
75108 | 174 |
val uri: URI, |
75393 | 175 |
val input: Bytes |
176 |
) { |
|
75146 | 177 |
def home: String = url_path(server_name, service_name) |
75107 | 178 |
def root: String = home + "/" |
179 |
def query: String = home + "?" |
|
180 |
||
75109 | 181 |
def toplevel: Boolean = uri_name == home || uri_name == root |
182 |
||
183 |
val uri_name: String = uri.toString |
|
75107 | 184 |
|
185 |
def uri_path: Option[Path] = |
|
186 |
for { |
|
75111 | 187 |
s <- Option(uri.getPath).flatMap(Library.try_unprefix(root, _)) |
188 |
if Path.is_wellformed(s) |
|
189 |
p = Path.explode(s) if p.all_basic |
|
75107 | 190 |
} yield p |
191 |
||
75112 | 192 |
def decode_query: Option[String] = |
193 |
Library.try_unprefix(query, uri_name).map(Url.decode) |
|
194 |
||
75107 | 195 |
def decode_properties: Properties.T = |
196 |
space_explode('&', input.text).map( |
|
197 |
{ |
|
198 |
case Properties.Eq(a, b) => Url.decode(a) -> Url.decode(b) |
|
199 |
case s => error("Malformed key-value pair in HTTP/POST: " + quote(s)) |
|
200 |
}) |
|
201 |
} |
|
202 |
||
203 |
||
65078 | 204 |
/* response */ |
205 |
||
75393 | 206 |
object Response { |
65078 | 207 |
def apply( |
208 |
bytes: Bytes = Bytes.empty, |
|
75106 | 209 |
content_type: String = Content.mime_type_bytes): Response = |
65078 | 210 |
new Response(bytes, content_type) |
211 |
||
212 |
val empty: Response = apply() |
|
75106 | 213 |
def text(s: String): Response = apply(Bytes(s), Content.mime_type_text) |
214 |
def html(s: String): Response = apply(Bytes(s), Content.mime_type_html) |
|
75105
03115c9eea00
support for PDF.js: platform-independent PDF viewer;
wenzelm
parents:
75104
diff
changeset
|
215 |
|
03115c9eea00
support for PDF.js: platform-independent PDF viewer;
wenzelm
parents:
75104
diff
changeset
|
216 |
def content(content: Content): Response = apply(content.bytes, content.mime_type) |
75106 | 217 |
def read(file: JFile): Response = content(Content.read(file)) |
218 |
def read(path: Path): Response = content(Content.read(path)) |
|
65078 | 219 |
} |
220 |
||
75393 | 221 |
class Response private[HTTP](val output: Bytes, val content_type: String) { |
75107 | 222 |
override def toString: String = output.toString |
65078 | 223 |
|
80201
6ac48d53d371
add HEAD to http server: should send same header fields as if request was GET;
Fabian Huch <huch@in.tum.de>
parents:
79717
diff
changeset
|
224 |
def write(http: HttpExchange, code: Int, is_head: Boolean = false): Unit = { |
75107 | 225 |
http.getResponseHeaders.set("Content-Type", content_type) |
80243
b2889dd54a2a
use Content-Digest header in HEAD requests instead of length (to track non-monotone changes);
Fabian Huch <huch@in.tum.de>
parents:
80202
diff
changeset
|
226 |
if (is_head) { |
b2889dd54a2a
use Content-Digest header in HEAD requests instead of length (to track non-monotone changes);
Fabian Huch <huch@in.tum.de>
parents:
80202
diff
changeset
|
227 |
val encoded_digest = Base64.encode(HexFormat.of().parseHex(SHA1.digest(output).toString)) |
b2889dd54a2a
use Content-Digest header in HEAD requests instead of length (to track non-monotone changes);
Fabian Huch <huch@in.tum.de>
parents:
80202
diff
changeset
|
228 |
http.getResponseHeaders.set("Content-Digest", "sha=:" + encoded_digest + ":") |
b2889dd54a2a
use Content-Digest header in HEAD requests instead of length (to track non-monotone changes);
Fabian Huch <huch@in.tum.de>
parents:
80202
diff
changeset
|
229 |
} |
80357
fe123d033e76
clarified signature: pro-forma support for Bytes with size: Long;
wenzelm
parents:
80243
diff
changeset
|
230 |
http.sendResponseHeaders(code, if (is_head) -1 else output.size) |
80201
6ac48d53d371
add HEAD to http server: should send same header fields as if request was GET;
Fabian Huch <huch@in.tum.de>
parents:
79717
diff
changeset
|
231 |
if (!is_head) using(http.getResponseBody)(output.write_stream) |
65078 | 232 |
} |
233 |
} |
|
234 |
||
235 |
||
75107 | 236 |
/* service */ |
66207 | 237 |
|
75393 | 238 |
abstract class Service(val name: String, method: String = "GET") { |
75146 | 239 |
override def toString: String = name |
75113 | 240 |
|
241 |
def apply(request: Request): Option[Response] |
|
242 |
||
75146 | 243 |
def context(server_name: String): String = |
244 |
proper_string(url_path(server_name, name)).getOrElse("/") |
|
75113 | 245 |
|
75394 | 246 |
def handler(server_name: String): HttpHandler = { (http: HttpExchange) => |
75113 | 247 |
val uri = http.getRequestURI |
248 |
val input = using(http.getRequestBody)(Bytes.read_stream(_)) |
|
80201
6ac48d53d371
add HEAD to http server: should send same header fields as if request was GET;
Fabian Huch <huch@in.tum.de>
parents:
79717
diff
changeset
|
249 |
val is_head = http.getRequestMethod == "HEAD" && method == "GET" |
6ac48d53d371
add HEAD to http server: should send same header fields as if request was GET;
Fabian Huch <huch@in.tum.de>
parents:
79717
diff
changeset
|
250 |
if (http.getRequestMethod == method || is_head) { |
75146 | 251 |
val request = new Request(server_name, name, uri, input) |
78768
280a228dc2f1
prefer Exn.result: avoid accidental capture of interrupts, similar to ML;
wenzelm
parents:
78243
diff
changeset
|
252 |
Exn.result(apply(request)) match { |
75113 | 253 |
case Exn.Res(Some(response)) => |
80201
6ac48d53d371
add HEAD to http server: should send same header fields as if request was GET;
Fabian Huch <huch@in.tum.de>
parents:
79717
diff
changeset
|
254 |
response.write(http, 200, is_head) |
75113 | 255 |
case Exn.Res(None) => |
80201
6ac48d53d371
add HEAD to http server: should send same header fields as if request was GET;
Fabian Huch <huch@in.tum.de>
parents:
79717
diff
changeset
|
256 |
Response.empty.write(http, 404, is_head) |
75113 | 257 |
case Exn.Exn(ERROR(msg)) => |
80201
6ac48d53d371
add HEAD to http server: should send same header fields as if request was GET;
Fabian Huch <huch@in.tum.de>
parents:
79717
diff
changeset
|
258 |
Response.text(Output.error_message_text(msg)).write(http, 500, is_head) |
75113 | 259 |
case Exn.Exn(exn) => throw exn |
75107 | 260 |
} |
75113 | 261 |
} |
262 |
else Response.empty.write(http, 400) |
|
75107 | 263 |
} |
73413 | 264 |
} |
66207 | 265 |
|
65077 | 266 |
|
267 |
/* server */ |
|
268 |
||
75393 | 269 |
class Server private[HTTP](val name: String, val http_server: HttpServer) { |
75107 | 270 |
def += (service: Service): Unit = |
75108 | 271 |
http_server.createContext(service.context(name), service.handler(name)) |
75107 | 272 |
def -= (service: Service): Unit = |
75108 | 273 |
http_server.removeContext(service.context(name)) |
65077 | 274 |
|
73439 | 275 |
def start(): Unit = http_server.start() |
73367 | 276 |
def stop(): Unit = http_server.stop(0) |
65077 | 277 |
|
278 |
def address: InetSocketAddress = http_server.getAddress |
|
75107 | 279 |
|
75108 | 280 |
def url: String = "http://" + address.getHostName + ":" + address.getPort + url_path(name) |
65077 | 281 |
override def toString: String = url |
282 |
} |
|
283 |
||
75107 | 284 |
def server( |
76270 | 285 |
port: Int = 0, |
79717 | 286 |
name: String = UUID.random_string(), |
75393 | 287 |
services: List[Service] = isabelle_services |
288 |
): Server = { |
|
76270 | 289 |
val http_server = HttpServer.create(new InetSocketAddress(isabelle.Server.localhost, port), 0) |
65077 | 290 |
http_server.setExecutor(null) |
65076 | 291 |
|
75107 | 292 |
val server = new Server(name, http_server) |
293 |
for (service <- services) server += service |
|
65077 | 294 |
server |
63823 | 295 |
} |
65079 | 296 |
|
297 |
||
65081 | 298 |
|
75107 | 299 |
/** Isabelle services **/ |
65081 | 300 |
|
75113 | 301 |
def isabelle_services: List[Service] = |
75145 | 302 |
List(Welcome_Service, Fonts_Service, PDFjs_Service, Docs_Service) |
65081 | 303 |
|
304 |
||
305 |
/* welcome */ |
|
306 |
||
75145 | 307 |
object Welcome_Service extends Welcome() |
308 |
||
75393 | 309 |
class Welcome(name: String = "") extends Service(name) { |
75113 | 310 |
def apply(request: Request): Option[Response] = |
311 |
if (request.toplevel) { |
|
312 |
Some(Response.text("Welcome to " + Isabelle_System.identification())) |
|
313 |
} |
|
314 |
else None |
|
315 |
} |
|
65081 | 316 |
|
317 |
||
318 |
/* fonts */ |
|
65079 | 319 |
|
75145 | 320 |
object Fonts_Service extends Fonts() |
321 |
||
75393 | 322 |
class Fonts(name: String = "fonts") extends Service(name) { |
75113 | 323 |
private lazy val html_fonts: List[Isabelle_Fonts.Entry] = |
324 |
Isabelle_Fonts.fonts(hidden = true) |
|
65079 | 325 |
|
75113 | 326 |
def apply(request: Request): Option[Response] = |
327 |
if (request.toplevel) { |
|
328 |
Some(Response.text(cat_lines(html_fonts.map(entry => entry.path.file_name)))) |
|
329 |
} |
|
330 |
else { |
|
331 |
request.uri_path.flatMap(path => |
|
332 |
html_fonts.collectFirst( |
|
333 |
{ case entry if path == entry.path.base => Response(entry.bytes) } |
|
334 |
)) |
|
335 |
} |
|
336 |
} |
|
75105
03115c9eea00
support for PDF.js: platform-independent PDF viewer;
wenzelm
parents:
75104
diff
changeset
|
337 |
|
03115c9eea00
support for PDF.js: platform-independent PDF viewer;
wenzelm
parents:
75104
diff
changeset
|
338 |
|
03115c9eea00
support for PDF.js: platform-independent PDF viewer;
wenzelm
parents:
75104
diff
changeset
|
339 |
/* pdfjs */ |
03115c9eea00
support for PDF.js: platform-independent PDF viewer;
wenzelm
parents:
75104
diff
changeset
|
340 |
|
75145 | 341 |
object PDFjs_Service extends PDFjs() |
342 |
||
75393 | 343 |
class PDFjs(name: String = "pdfjs") extends Service(name) { |
75113 | 344 |
def apply(request: Request): Option[Response] = |
75105
03115c9eea00
support for PDF.js: platform-independent PDF viewer;
wenzelm
parents:
75104
diff
changeset
|
345 |
for { |
75107 | 346 |
p <- request.uri_path |
75117 | 347 |
path = Path.explode("$ISABELLE_PDFJS_HOME") + p if path.is_file |
348 |
s = p.implode if s.startsWith("build/") || s.startsWith("web/") |
|
75113 | 349 |
} yield Response.read(path) |
350 |
} |
|
75119 | 351 |
|
352 |
||
353 |
/* docs */ |
|
354 |
||
75145 | 355 |
object Docs_Service extends Docs() |
356 |
||
75393 | 357 |
class Docs(name: String = "docs") extends PDFjs(name) { |
75119 | 358 |
private val doc_contents = isabelle.Doc.main_contents() |
359 |
||
75121 | 360 |
// example: .../docs/web/viewer.html?file=system.pdf |
75119 | 361 |
def doc_request(request: Request): Option[Response] = |
362 |
for { |
|
363 |
p <- request.uri_path if p.is_pdf |
|
75121 | 364 |
s = p.implode if s.startsWith("web/") |
75119 | 365 |
name = p.base.split_ext._1.implode |
81350
1818358373e2
misc tuning and clarification: Doc.Entry supports both plain files and pdf documents;
wenzelm
parents:
80368
diff
changeset
|
366 |
entry <- doc_contents.entries(name = _ == name, pdf = true).headOption |
1818358373e2
misc tuning and clarification: Doc.Entry supports both plain files and pdf documents;
wenzelm
parents:
80368
diff
changeset
|
367 |
} yield Response.read(entry.path) |
75119 | 368 |
|
369 |
override def apply(request: Request): Option[Response] = |
|
370 |
doc_request(request) orElse super.apply(request) |
|
371 |
} |
|
372 |
} |