Consolidated ASP Classic MVC framework from best components
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

49 lignes
1.2KB

  1. <%
  2. Function BuildRequestOrigin()
  3. Dim protocol
  4. protocol = "http://"
  5. If LCase(Request.ServerVariables("HTTPS")) = "on" Then
  6. protocol = "https://"
  7. End If
  8. BuildRequestOrigin = protocol & Request.ServerVariables("HTTP_HOST")
  9. End Function
  10. Function GetProductionBaseUrl()
  11. Dim configuredUrl
  12. configuredUrl = GetAppSetting("ProductionAppBaseUrl")
  13. If configuredUrl = "nothing" Or Len(Trim(configuredUrl)) = 0 Then
  14. GetProductionBaseUrl = BuildRequestOrigin() & "/"
  15. Else
  16. If Right(configuredUrl, 1) <> "/" Then
  17. configuredUrl = configuredUrl & "/"
  18. End If
  19. GetProductionBaseUrl = configuredUrl
  20. End If
  21. End Function
  22. Function FetchPage(path)
  23. Dim http, result, targetUrl
  24. targetUrl = GetProductionBaseUrl()
  25. If Left(path, 1) = "/" Then
  26. path = Mid(path, 2)
  27. End If
  28. targetUrl = targetUrl & path
  29. Set http = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
  30. http.Open "GET", targetUrl, False
  31. http.Send
  32. Set result = Server.CreateObject("Scripting.Dictionary")
  33. result.Add "url", targetUrl
  34. result.Add "status", http.Status
  35. result.Add "body", http.responseText
  36. Set FetchPage = result
  37. Set http = Nothing
  38. End Function
  39. %>

Powered by TurnKey Linux.