| 382 | | |
|---|
| | 394 | /****************************************************************************** |
|---|
| | 395 | |
|---|
| | 396 | Extends the method servlet with a way to use GET for everything, |
|---|
| | 397 | where the dispatch is instead defined via a query-parameter called |
|---|
| | 398 | 'request' |
|---|
| | 399 | |
|---|
| | 400 | ******************************************************************************/ |
|---|
| | 401 | |
|---|
| | 402 | class GetServlet : MethodServlet |
|---|
| | 403 | { |
|---|
| | 404 | /********************************************************************** |
|---|
| | 405 | |
|---|
| | 406 | |
|---|
| | 407 | **********************************************************************/ |
|---|
| | 408 | |
|---|
| | 409 | this (char[] name = null) |
|---|
| | 410 | { |
|---|
| | 411 | super (name); |
|---|
| | 412 | } |
|---|
| | 413 | |
|---|
| | 414 | /********************************************************************** |
|---|
| | 415 | |
|---|
| | 416 | Service implementation for method specific isolation. |
|---|
| | 417 | |
|---|
| | 418 | **********************************************************************/ |
|---|
| | 419 | |
|---|
| | 420 | void service (IServletRequest request, IServletResponse response) |
|---|
| | 421 | { |
|---|
| | 422 | auto method = request.method; |
|---|
| | 423 | auto query = request.uri.getQuery; |
|---|
| | 424 | auto index = Util.locatePattern (query, "request="); |
|---|
| | 425 | |
|---|
| | 426 | if (index < query.length) |
|---|
| | 427 | method = query [index+8 .. Util.locate (query, '&', index+8)]; |
|---|
| | 428 | |
|---|
| | 429 | super.service (method, request, response); |
|---|
| | 430 | } |
|---|
| | 431 | } |
|---|