This commit is contained in:
@@ -10,18 +10,25 @@ Imports System.IO
|
||||
Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
|
||||
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
|
||||
If context.Request("metodo").ToString() = "GetTokenAngular" Then
|
||||
If context.Request("metodo") IsNot Nothing AndAlso context.Request("metodo").ToString() = "GetTokenAngular" Then
|
||||
'context.Response.ContentType = "application/json; charset=utf-8"
|
||||
|
||||
context.Response.ContentType = "text/json"
|
||||
Dim origin As String = context.Request.UrlReferrer.ToString()
|
||||
context.Response.AddHeader("Access-Control-Allow-Origin", origin.Substring(0, origin.Length - 1))
|
||||
If context.Request IsNot Nothing AndAlso context.Request.UrlReferrer IsNot Nothing Then
|
||||
Dim origin As String = context.Request.UrlReferrer.ToString()
|
||||
context.Response.AddHeader("Access-Control-Allow-Origin", origin.Substring(0, origin.Length - 1))
|
||||
End If
|
||||
'context.Response.AddHeader("Access-Control-Allow-Origin", "http://localhost:4200")
|
||||
'context.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST")
|
||||
context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept")
|
||||
context.Response.AddHeader("Access-Control-Allow-Credentials", "true")
|
||||
context.Response.StatusCode = 200
|
||||
Dim key As String = GetTokenAngular(context)
|
||||
Dim key As String = ""
|
||||
Try
|
||||
key = GetTokenAngular(context)
|
||||
Catch ex As Exception
|
||||
GuardaLog(ex.ToString())
|
||||
End Try
|
||||
Dim json As String = JsonConvert.SerializeObject(key)
|
||||
context.Response.Write(json)
|
||||
context.Response.Flush()
|
||||
|
||||
Reference in New Issue
Block a user