Skip to content

Commit a439db0

Browse files
committed
Output 401 if someone tries to get access without credentials
1 parent f7d4c9c commit a439db0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

MDX2JSON/AbstractREST.cls.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,16 @@ Called for a REST page in the event of a login being required</Description>
222222
Do %response.SetHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Accept-Language, X-Requested-With")
223223
224224
Set %response.CharSet = "utf-8"
225-
Set %response.ContentType="application/json"
225+
Set %response.ContentType = "application/json"
226226
227227
If (%request.GetCgiEnv("REQUEST_METHOD") = "OPTIONS"){
228228
Do %response.WriteHTTPHeader()
229229
Return $$$OK
230230
}
231+
Set %response.Status = "401 Unauthorized"
231232
232233
#; Don't want the session token
233-
Set %response.OutputSessionToken=0
234+
Set %response.OutputSessionToken = 0
234235
235236
#; We want Basic authentication
236237
//Do %response.SetHeader("WWW-Authenticate","Basic")

0 commit comments

Comments
 (0)