first commit
This commit is contained in:
60
CryptoJS/sproxy.asp
Normal file
60
CryptoJS/sproxy.asp
Normal file
@@ -0,0 +1,60 @@
|
||||
<% @Language="VBScript" CODEPAGE="65001" %>
|
||||
<%
|
||||
Set objwinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
|
||||
|
||||
objwinHttp.Open "POST", Request("url")
|
||||
objwinHttp.SetRequestHeader "Content-type",Request("Contype")
|
||||
objwinHttp.SetRequestHeader "x-ncp-iam-access-key",Request("acckey")
|
||||
objwinHttp.SetRequestHeader "x-ncp-apigw-timestamp",Request("apitsp")
|
||||
objwinHttp.SetRequestHeader "x-ncp-apigw-signature-v2",Request("sigkey")
|
||||
|
||||
objwinHttp.Send Request("body")
|
||||
|
||||
If Err.Number = 0 Then
|
||||
If objWinHttp.Status = "200" Then
|
||||
rtxt = fnStreamBinaryToString(objWinHttp.ResponseBody, "UTF-8")
|
||||
else
|
||||
rtxt = "Status Err :" & Err.Number & ", " & Err.Description
|
||||
End if
|
||||
Else
|
||||
rtxt = "Err :" & Err.Number & ", " & Err.Description
|
||||
end if
|
||||
Set objWinHttp = Nothing
|
||||
|
||||
'returnMsg = fnStreamBinaryToString(objWinHttp.ResponseBody, "UTF-8")
|
||||
'Response.ContentType="application/javascript;charset=utf-8"
|
||||
|
||||
|
||||
'set objWinHttp = nothing
|
||||
|
||||
Function fnStreamBinaryToString(Binary, CharSet)
|
||||
Const adTypeText = 2
|
||||
Const adTypeBinary = 1
|
||||
|
||||
Dim BinaryStream
|
||||
Set BinaryStream = CreateObject("ADODB.Stream")
|
||||
|
||||
BinaryStream.Type = adTypeBinary
|
||||
|
||||
BinaryStream.Open
|
||||
BinaryStream.Write Binary
|
||||
|
||||
BinaryStream.Position = 0
|
||||
BinaryStream.Type = adTypeText
|
||||
|
||||
If Len(CharSet) > 0 Then
|
||||
BinaryStream.CharSet = CharSet
|
||||
Else
|
||||
BinaryStream.CharSet = "us-ascii"
|
||||
End If
|
||||
fnStreamBinaryToString = BinaryStream.ReadText
|
||||
End Function
|
||||
|
||||
Function URLDecode(str)
|
||||
Dim objScript
|
||||
Set objScript = Server.CreateObject("ScriptControl")
|
||||
objScript.Language = "JavaScript"
|
||||
URLDecode = objScript.Eval("decodeURIComponent(""" & str & """.replace(/\+/g,"" ""))")
|
||||
Set objScript = Nothing
|
||||
End Function
|
||||
%>
|
||||
Reference in New Issue
Block a user