Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

85 строки
2.5KB

  1. <%@ Language="VBScript" %>
  2. <% Option Explicit %>
  3. <%
  4. ' Intentionally byte-identical to /public/Default.asp. This is the test
  5. ' app's own bootstrap (separate IIS site/physical path from production),
  6. ' but the bootstrap logic itself is fully generic - it doesn't hardcode
  7. ' which routes exist (that lives in Framework/Application.wsc, shared by
  8. ' both sites via COM registration) or which site is calling it. If you
  9. ' change this file's logic, change public/Default.asp the same way, and
  10. ' vice versa. See docs/ARCHITECTURE.md for why there are two IIS sites.
  11. Dim route, httpMethod, logDir, ctx, app, statusLine, contentType, body
  12. route = Request.QueryString("route")
  13. httpMethod = Request.ServerVariables("REQUEST_METHOD")
  14. ' logs/ deliberately lives outside the served "public" webroot (IIS site
  15. ' physical path = public/), so a parent-relative MapPath is required here -
  16. ' requires enableParentPaths=true for this site. See docs/DECISIONS.md.
  17. logDir = Server.MapPath("../logs")
  18. Set ctx = Nothing
  19. On Error Resume Next
  20. Set ctx = Server.CreateObject("WscMvc.RequestContext")
  21. If Err.Number <> 0 Then
  22. Err.Clear
  23. On Error Goto 0
  24. Response.Status = "500 Internal Server Error"
  25. Response.ContentType = "text/plain; charset=utf-8"
  26. Response.Write "Internal Server Error"
  27. Response.End
  28. End If
  29. On Error Goto 0
  30. On Error Resume Next
  31. ctx.Initialize route, httpMethod, logDir
  32. If Err.Number <> 0 Then
  33. Err.Clear
  34. On Error Goto 0
  35. Set ctx = Nothing
  36. Response.Status = "500 Internal Server Error"
  37. Response.ContentType = "text/plain; charset=utf-8"
  38. Response.Write "Internal Server Error"
  39. Response.End
  40. End If
  41. On Error Goto 0
  42. Set app = Nothing
  43. On Error Resume Next
  44. Set app = Server.CreateObject("WscMvc.Application")
  45. If Err.Number <> 0 Then
  46. Err.Clear
  47. On Error Goto 0
  48. Set ctx = Nothing
  49. Response.Status = "500 Internal Server Error"
  50. Response.ContentType = "text/plain; charset=utf-8"
  51. Response.Write "Internal Server Error"
  52. Response.End
  53. End If
  54. On Error Goto 0
  55. statusLine = ""
  56. contentType = ""
  57. body = ""
  58. On Error Resume Next
  59. app.Run ctx, statusLine, contentType, body
  60. If Err.Number <> 0 Then
  61. Err.Clear
  62. On Error Goto 0
  63. Set app = Nothing
  64. Set ctx = Nothing
  65. Response.Status = "500 Internal Server Error"
  66. Response.ContentType = "text/plain; charset=utf-8"
  67. Response.Write "Internal Server Error"
  68. Response.End
  69. End If
  70. On Error Goto 0
  71. Response.Status = statusLine
  72. Response.ContentType = contentType
  73. Response.Write body
  74. Set app = Nothing
  75. Set ctx = Nothing
  76. %>

Powered by TurnKey Linux.