@@ -17,9 +17,14 @@ Add param Namespace to a request to execute in desired namespace. Package must b
1717 #dim %response As %CSP.Response
1818 #dim %request As %CSP.Request
1919 #dim %session As %CSP.Session
20+
21+ Do %response.SetHeader("Access-Control-Allow-Origin","*")
22+ Do %response.SetHeader("Access-Control-Allow-Methods","GET, PUT, POST, DELETE, OPTIONS")
23+ Do %response.SetHeader("Access-Control-Max-Age","10000")
24+ Do %response.SetHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Accept-Language")
2025
21- set %response.ContentType="text /json"
22- set %session.Language=$$MatchLanguage^%occMessages(%request.GetCgiEnv("HTTP_ACCEPT_LANGUAGE"),"%CSP","+s") // Localization support
26+ Set %response.ContentType="application /json"
27+ Set %session.Language=$$MatchLanguage^%occMessages(%request.GetCgiEnv("HTTP_ACCEPT_LANGUAGE"),"%CSP","+s") // Localization support
2328
2429 #dim tSC As %Status = $$$OK
2530 #dim e As %Exception.AbstractException
@@ -308,6 +313,36 @@ This project creates the DispatchMethod used to dispatch the Url and Method to t
308313]]> </Implementation >
309314</Method >
310315
316+ <UDLText name =" T" >
317+ <Content ><![CDATA[
318+ /**
319+ Called for a REST page in the event of a login being required
320+ **/
321+ ]]> </Content >
322+ </UDLText >
323+
324+ <Method name =" Login" >
325+ <ClassMethod >1</ClassMethod >
326+ <FormalSpec >skipheader:%Boolean=1</FormalSpec >
327+ <ReturnType >%Status</ReturnType >
328+ <Implementation ><![CDATA[
329+ Do %response.SetHeader("Access-Control-Allow-Origin","*")
330+ Do %response.SetHeader("Access-Control-Allow-Methods","GET, PUT, POST, DELETE, OPTIONS")
331+ Do %response.SetHeader("Access-Control-Max-Age","10000")
332+ Do %response.SetHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Accept-Language")
333+
334+ Set %response.CharSet = "utf-8"
335+ Set %response.ContentType="application/json"
336+
337+ If (%request.GetCgiEnv("REQUEST_METHOD") = "OPTIONS"){
338+ Do %response.WriteHTTPHeader()
339+ Return $$$OK
340+ }
341+
342+ Quit ##super(skipheader)
343+ ]]> </Implementation >
344+ </Method >
345+
311346<UDLText name =" T" >
312347<Content ><![CDATA[
313348/**
0 commit comments