Пример #1
0
def Report(requestData):
    
    TAG = Const.Tags.Urls.MODERATION_REPORT
    
    securityProperties = RunThroughSecurityLayer(TAG, requestData)
    if (not securityProperties.isSecure):
        return securityProperties.httpResponse
    
    try:
        clientUser = securityProperties.userObject
        clientContentId = securityProperties.jsonRequestData[Const.Views.Report.JsonRequestKey.CONTENT_ID]
        
        # check that the content exists in the database
        clientContent = QueryManager.GetObjectByID(OnlineContent, clientContentId)
        if (not clientContent):
            DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                       responseCode=Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_NOT_FOUND, 
                                       messageCode=Const.DataCollection.MessageCodes.ModerationReport.CONTENT_NOT_FOUND)  
            
            return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_NOT_FOUND, 
                                                        Const.DataCollection.MessageCodes.ModerationReport.CONTENT_NOT_FOUND)
        
        # get the content type that the user is reporting
        contentType = clientContent.contentType
        
        # check if this user has already tried to create this report
        userDupeReports = ReportModel.objects.filter(fromUser=clientUser,
                                                contentID=clientContentId)
        
        # If so, log the hit and return an error to client
        if (userDupeReports):
            DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                       responseCode=Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_CONFLICT, 
                                       messageCode=Const.DataCollection.MessageCodes.ModerationReport.REPORT_EXISTS) 
             
            return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_CONFLICT, 
                                                        Const.DataCollection.MessageCodes.ModerationReport.REPORT_EXISTS) 
        
        # Create the report
        ReportModel.objects.create(fromUser=clientUser,
                                   contentID=Utils.UUIDToBinary(clientContentId),
                                   contentType=contentType)  
        
        # Log the hit and return
        DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                   responseCode=Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK, 
                                   messageCode=Const.DataCollection.MessageCodes.ModerationReport.REQUEST_SUCCESSFUL) 
        
        return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK,
                                                    Const.DataCollection.MessageCodes.ModerationReport.REQUEST_SUCCESSFUL)    
                
    except Exception as e:
        # log and return on error
        DataCollector.logServerError(e)
        DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                    responseCode=Const.HttpResponseFactory.ResponseCodes.ServerError.CODE_INTERNAL_SERVER_ERROR, 
                                    messageCode=Const.DataCollection.MessageCodes.ModerationReport.REQUEST_FAILED_SERVER_ERROR) 
        
        return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ServerError.CODE_INTERNAL_SERVER_ERROR, 
                                                    Const.DataCollection.MessageCodes.ModerationReport.REQUEST_FAILED_SERVER_ERROR)
Пример #2
0
def UploadLive(requestData):
    TAG = Const.Tags.Urls.UPLOAD_LIVE

    securityProperties = RunThroughSecurityLayer(TAG, requestData)
    if (not securityProperties.isSecure):
        return securityProperties.httpResponse
    
    try:       
        clientUser = securityProperties.userObject
        clientSession = securityProperties.userSession
        clientThreadText= securityProperties.jsonRequestData[Const.Views.UploadThread.JsonRequestKey.THREAD_TEXT]
        clientThreadKey = securityProperties.jsonRequestData[Const.Views.UploadThread.JsonRequestKey.THREAD_URL]
        clientThreadARN = securityProperties.jsonRequestData[Const.Views.UploadThread.JsonRequestKey.THREAD_ARN]
 
        # check if this user is posting too fast
        if (settings.RATE_LIMIT_LIVE and RateLimiter.UserLiveRateLimitExceeded(clientUser.id)): 
                  
            # log the warning and return if too many threads
            DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                       responseCode=Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_TOO_MANY_REQUESTS, 
                                       messageCode=Const.DataCollection.MessageCodes.UploadLive.RATE_LIMIT_EXCEEDED)

            return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_TOO_MANY_REQUESTS, 
                                                        Const.DataCollection.MessageCodes.UploadLive.RATE_LIMIT_EXCEEDED) 

        # Save the live thread in the DB
        # Save title as an empty string if it is empty
        if (Utils.StringIsEmpty(clientThreadText)):
            clientThreadText = ''
               
        Thread.objects.create(fromUser=clientUser,
                              fromSession=clientSession,
                              contentType=Const.Tags.ContentTypes.THREAD,
                              text=clientThreadText,
                              key=clientThreadKey,
                              arn=clientThreadARN)
                     

        QueryManager.CheckAndPruneThreads()           
       
        # FOR RELEASE 1.1
        # return the list of threads after a successful thread upload    
        jsonString = GetThreadListJsonString()

        # log and return on success   
        DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                    responseCode=Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK, 
                                    messageCode=Const.DataCollection.MessageCodes.UploadLive.POST_SUCCESSFUL)         
       
        return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK, 
                                                    jsonString, 'application/json')
        
    except Exception as e:
        DataCollector.logServerError(e)
        DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                    responseCode=Const.HttpResponseFactory.ResponseCodes.ServerError.CODE_INTERNAL_SERVER_ERROR, 
                                    messageCode=Const.DataCollection.MessageCodes.UploadLive.POST_FAILED_SERVER_ERROR)  

        return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ServerError.CODE_INTERNAL_SERVER_ERROR, 
                                                    Const.DataCollection.MessageCodes.UploadLive.POST_FAILED_SERVER_ERROR)
Пример #3
0
def GetLive(requestData):
    TAG = Const.Tags.Urls.GET_LIVE
        
    securityProperties = RunThroughSecurityLayer(TAG, requestData)
    if (not securityProperties.isSecure):
        return securityProperties.httpResponse
    
    try:        
        # Get the list of threads
        jsonString = GetThreadListJsonString()

        # log and return on success          
        DataCollector.UpdateURLHit(hitID=securityProperties.hitID, 
                                   responseCode=Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK,
                                   messageCode=Const.DataCollection.MessageCodes.GetLive.REQUEST_SUCCESSFUL)
                       
        return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK, 
                                                    jsonString, 'application/json')
    
    except Exception as e:
        # log and return on error
        DataCollector.logServerError(e)
        DataCollector.UpdateURLHit(hitID=securityProperties.hitID, 
                                   responseCode=Const.HttpResponseFactory.ResponseCodes.ServerError.CODE_INTERNAL_SERVER_ERROR,
                                   messageCode=Const.DataCollection.MessageCodes.GetLive.REQUEST_FAILED_SERVER_ERROR)
 
        return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ServerError.CODE_INTERNAL_SERVER_ERROR, 
                                                    Const.DataCollection.MessageCodes.GetLive.REQUEST_FAILED_SERVER_ERROR)
Пример #4
0
def SubscribeLive(requestData):
    TAG = Const.Tags.Urls.SUBSCRIBE_LIVE
        
    securityProperties = RunThroughSecurityLayer(TAG, requestData)
    if (not securityProperties.isSecure):
        return securityProperties.httpResponse
    
    try:        
        instanceID = securityProperties.jsonRequestData[Const.Views.SubscribeLive.JsonRequestKey.INSTANCE_ID]
        threadID = securityProperties.jsonRequestData[Const.Views.SubscribeLive.JsonRequestKey.THREAD_ID]

        # Check that the thread exists
        if (not QueryManager.ContentIsOnline(threadID)):
            # If not, return 404
            DataCollector.UpdateURLHit(hitID=securityProperties.hitID, 
                                   responseCode=Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_NOT_FOUND,
                                   messageCode=Const.DataCollection.MessageCodes.SubscribeLive.THREAD_NOT_FOUND)
                       
            return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_NOT_FOUND,
                                                        Const.DataCollection.MessageCodes.SubscribeLive.THREAD_NOT_FOUND)
        
        # try to subscribe to the thread
        googleResponseCode = GCMManager.SubscribeUserToThread(instanceID, threadID)
        
        # check the response. If it was not successful, return an error
        if (googleResponseCode != Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK):
                DataCollector.UpdateURLHit(hitID=securityProperties.hitID, 
                                   responseCode=Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_BAD_REQUEST,
                                   messageCode=Const.DataCollection.MessageCodes.SubscribeLive.GCM_SUBSCRIBE_FAILED)
                       
                return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_BAD_REQUEST,
                                                            Const.DataCollection.MessageCodes.SubscribeLive.GCM_SUBSCRIBE_FAILED)
            

        # log and return on success          
        DataCollector.UpdateURLHit(hitID=securityProperties.hitID, 
                                   responseCode=Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK,
                                   messageCode=Const.DataCollection.MessageCodes.SubscribeLive.REQUEST_SUCCESSFUL)
                       
        return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK,
                                                    Const.DataCollection.MessageCodes.SubscribeLive.REQUEST_SUCCESSFUL)
    
    except Exception as e:
        # log and return on error
        DataCollector.logServerError(e)
        DataCollector.UpdateURLHit(hitID=securityProperties.hitID, 
                                   responseCode=Const.HttpResponseFactory.ResponseCodes.ServerError.CODE_INTERNAL_SERVER_ERROR,
                                   messageCode=Const.DataCollection.MessageCodes.SubscribeLive.REQUEST_FAILED_SERVER_ERROR)
 
        return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ServerError.CODE_INTERNAL_SERVER_ERROR, 
                                                    Const.DataCollection.MessageCodes.SubscribeLive.REQUEST_FAILED_SERVER_ERROR)
Пример #5
0
def Login(requestData):
    TAG = Const.Tags.Urls.SECURITY_LOGIN

    securityProperties = RunThroughSecurityLayer(TAG, requestData)
    if (not securityProperties.isSecure):
        return securityProperties.httpResponse

    try:
        currentTime = int(time.time())
        timeSessionExpires = currentTime + settings.AWS_COGNITO_TOKEN_DURATION

        # Get the client user
        clientUser = securityProperties.userObject

        # Login to Cognito and retrieve the access token for this client
        # We login with our uuid
        token = AuthManager.LoginWithCognitoIdentity(securityProperties.userID)

        # Create a new user session in the DB
        Session.objects.create(fromUser=securityProperties.userObject,
                               timeExpires=timeSessionExpires,
                               token=token)

        jsonString = json.dumps(_LoginClientObject(token).getOrderedDict())

        DataCollector.UpdateURLHit(
            hitID=securityProperties.hitID,
            responseCode=Const.HttpResponseFactory.ResponseCodes.Success.
            CODE_OK,
            messageCode=Const.DataCollection.MessageCodes.SecurityLogin.
            REQUEST_SUCCESSFUL)

        return HttpResponseFactory.MakeHttpResponse(
            Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK,
            jsonString, 'application/json')

    except Exception as e:
        DataCollector.logServerError(e)
        DataCollector.UpdateURLHit(
            hitID=securityProperties.hitID,
            responseCode=Const.HttpResponseFactory.ResponseCodes.ServerError.
            CODE_INTERNAL_SERVER_ERROR,
            messageCode=Const.DataCollection.MessageCodes.SecurityLogin.
            REQUEST_FAILED_SERVER_ERROR)

        return HttpResponseFactory.MakeHttpResponse(
            Const.HttpResponseFactory.ResponseCodes.ServerError.
            CODE_INTERNAL_SERVER_ERROR, Const.DataCollection.MessageCodes.
            SecurityCreate.CREATE_FAILED_SERVER_ERROR)
Пример #6
0
def CreateUser(requestData):
    TAG = Const.Tags.Urls.SECURITY_CREATE

    securityProperties = RunThroughSecurityLayer(TAG, requestData)
    if (not securityProperties.isSecure):
        return securityProperties.httpResponse

    try:
        # Create the new user identity in the db
        with transaction.atomic():
            newUser = User.objects.create()
            newUserID = Utils.BinaryToUUID(newUser.id)
            identityID = ''

            # Create a new identity on Cognito with the new uuid
            # Only when in not in DEBUG. I don't want to get charged ;)
            if (not settings.DEBUG):
                identityID = AuthManager.CreateNewCognitoIdentity(newUserID)

            jsonDict = _CreateUserClientObject(newUserID,
                                               identityID).getOrderedDict()
            jsonString = json.dumps(jsonDict)
            logger.info(jsonString)

            # Update the URL hit and return
            DataCollector.UpdateURLHit(
                hitID=securityProperties.hitID,
                responseCode=Const.HttpResponseFactory.ResponseCodes.Success.
                CODE_OK,
                messageCode=Const.DataCollection.MessageCodes.SecurityCreate.
                CREATE_SUCCESSFUL)

            return HttpResponseFactory.MakeHttpResponse(
                Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK,
                jsonString, 'application/json')

    except Exception as e:
        DataCollector.logServerError(e)
        DataCollector.UpdateURLHit(
            hitID=securityProperties.hitID,
            responseCode=Const.HttpResponseFactory.ResponseCodes.ServerError.
            CODE_INTERNAL_SERVER_ERROR,
            messageCode=Const.DataCollection.MessageCodes.SecurityCreate.
            CREATE_FAILED_SERVER_ERROR)

        return HttpResponseFactory.MakeHttpResponse(
            Const.HttpResponseFactory.ResponseCodes.ServerError.
            CODE_INTERNAL_SERVER_ERROR, Const.DataCollection.MessageCodes.
            SecurityCreate.CREATE_FAILED_SERVER_ERROR)
Пример #7
0
def AnalyticsFeedback(requestData):
    TAG = Const.Tags.Urls.ANALYTICS_FEEDBACK

    securityProperties = RunThroughSecurityLayer(TAG, requestData)
    if (not securityProperties.isSecure):
        return securityProperties.httpResponse

    try:
        clientFeedbackText = securityProperties.jsonRequestData[
            Const.Views.AnalyticsFeedback.JsonRequestKey.TEXT]

        # Save the feedback in the DB
        Feedback.objects.create(fromUser=securityProperties.userObject,
                                text=clientFeedbackText)

        # Update the URL hit and return
        DataCollector.UpdateURLHit(
            hitID=securityProperties.hitID,
            responseCode=Const.HttpResponseFactory.ResponseCodes.Success.
            CODE_OK,
            messageCode=Const.DataCollection.MessageCodes.AnalyticsFeedback.
            REQUEST_SUCCESSFUL)

        return HttpResponseFactory.MakeHttpResponse(
            Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK, Const.
            DataCollection.MessageCodes.AnalyticsFeedback.REQUEST_SUCCESSFUL)

    except Exception as e:
        DataCollector.logServerError(e)
        DataCollector.UpdateURLHit(
            hitID=securityProperties.hitID,
            responseCode=Const.HttpResponseFactory.ResponseCodes.ServerError.
            CODE_INTERNAL_SERVER_ERROR,
            messageCode=Const.DataCollection.MessageCodes.AnalyticsFeedback.
            REQUEST_FAILED_SERVER_ERROR)

        return HttpResponseFactory.MakeHttpResponse(
            Const.HttpResponseFactory.ResponseCodes.ServerError.
            CODE_INTERNAL_SERVER_ERROR, Const.DataCollection.MessageCodes.
            AnalyticsFeedback.REQUEST_FAILED_SERVER_ERROR)
Пример #8
0
def GetReply(requestData):
    TAG = Const.Tags.Urls.GET_REPLY

    securityProperties = RunThroughSecurityLayer(TAG, requestData)
    if (not securityProperties.isSecure):
        return securityProperties.httpResponse

    try:

        clientUser = securityProperties.userObject
        clientThreadID = securityProperties.jsonRequestData[
            Const.Views.GetReply.JsonRequestKey.THREAD_ID]

        # Retrieve the thread and replies from the database
        thread = QueryManager.GetObjectByID(Thread, clientThreadID)
        threadReplies = Reply.objects.filter(parentThread=thread)

        if (not thread):
            DataCollector.UpdateURLHit(
                hitID=securityProperties.hitID,
                responseCode=Const.HttpResponseFactory.ResponseCodes.
                ClientError.CODE_NOT_FOUND,
                messageCode=Const.DataCollection.MessageCodes.GetReply.
                THREAD_NOT_FOUND)

            return HttpResponseFactory.MakeHttpResponse(
                Const.HttpResponseFactory.ResponseCodes.ClientError.
                CODE_NOT_FOUND,
                Const.DataCollection.MessageCodes.GetReply.THREAD_NOT_FOUND)

        # Package the thread replies and return
        clientReplyListToReturn = []
        for reply in threadReplies:
            replyClientObject = GetReplyClientObject(text=reply.text,
                                                     time=reply.timeCreated,
                                                     id=Utils.BinaryToUUID(
                                                         reply.id),
                                                     key=reply.key)
            clientReplyListToReturn.append(replyClientObject.getDict())

        jsonString = json.dumps(clientReplyListToReturn)

        # log and return on success
        DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                   responseCode=Const.HttpResponseFactory.
                                   ResponseCodes.Success.CODE_OK,
                                   messageCode=Const.DataCollection.
                                   MessageCodes.GetReply.REQUEST_SUCCESSFUL)

        return HttpResponseFactory.MakeHttpResponse(
            Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK,
            jsonString, 'application/json')

    except Exception as e:
        DataCollector.logServerError(e)
        DataCollector.UpdateURLHit(
            hitID=securityProperties.hitID,
            responseCode=Const.HttpResponseFactory.ResponseCodes.ServerError.
            CODE_INTERNAL_SERVER_ERROR,
            messageCode=Const.DataCollection.MessageCodes.GetReply.
            REQUEST_FAILED_SERVER_ERROR)

        return HttpResponseFactory.MakeHttpResponse(
            Const.HttpResponseFactory.ResponseCodes.ServerError.
            CODE_INTERNAL_SERVER_ERROR, Const.DataCollection.MessageCodes.
            GetReply.REQUEST_FAILED_SERVER_ERROR)
Пример #9
0
def UploadReply(requestData):
    TAG = Const.Tags.Urls.UPLOAD_REPLY
     
    securityProperties = RunThroughSecurityLayer(TAG, requestData)
    if (not securityProperties.isSecure):
        return securityProperties.httpResponse
    
    try:
        clientUser = securityProperties.userObject
        clientSession = securityProperties.userSession
        clientThreadID = securityProperties.jsonRequestData[Const.Views.UploadReply.JsonRequestKey.THREAD_ID]
        clientReplyText= securityProperties.jsonRequestData[Const.Views.UploadReply.JsonRequestKey.REPLY_TEXT]
        clientReplyKey = securityProperties.jsonRequestData[Const.Views.UploadReply.JsonRequestKey.REPLY_URL]

        # Moderation - check if this user is posting replies too fast
        if (settings.RATE_LIMIT_LIVE and RateLimiter.UserReplyRateLimitExceeded(clientUser.id)):
            DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                       responseCode=Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_TOO_MANY_REQUESTS, 
                                       messageCode=Const.DataCollection.MessageCodes.UploadReply.RATE_LIMIT_EXCEEDED)  
            
            return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_TOO_MANY_REQUESTS, 
                                                        Const.DataCollection.MessageCodes.UploadReply.RATE_LIMIT_EXCEEDED)
        
        # Find the parent thread to reply to in the DB  
        threadToReplyTo = QueryManager.GetObjectByID(Thread, clientThreadID)
        
        if (not threadToReplyTo):
            DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                       responseCode=Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_NOT_FOUND, 
                                       messageCode=Const.DataCollection.MessageCodes.UploadReply.THREAD_NOT_FOUND) 
            
            return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ClientError.CODE_NOT_FOUND, 
                                                        Const.DataCollection.MessageCodes.UploadReply.THREAD_NOT_FOUND)

        # These fields are optional. Make sure that they go into the DB
        # as an empty string if they are not present 
        if (Utils.StringIsEmpty(clientReplyText)):
            clientReplyText = ''
        if (Utils.StringIsEmpty(clientReplyKey)):
            clientReplyKey = ''

        # Save the reply in the DB
        newReply = Reply.objects.create(fromUser=clientUser,
                             fromSession=clientSession,
                             contentType=Const.Tags.ContentTypes.REPLY,
                             parentThread=threadToReplyTo,
                             text=clientReplyText,
                             key=clientReplyKey)
        
        # Broadcast the reply out to this thread's subscribers using GCM
        # Create the client reply object
        newReplyClientObject = GetReplyClientObject(text=newReply.text, 
                                                    time=newReply.timeCreated, 
                                                    id=Utils.BinaryToUUID(newReply.id), 
                                                    key=newReply.key) 
        
        # Turn it into JSON and send it off
        googleResponseCode = GCMManager.BroadcastReplyToSubscribers(parentThreadID=clientThreadID,
                                               newReplyJSON=newReplyClientObject.getDict()) 
        
        # Check the response code from google
        # If it is not successful, return and log a warning, but still
        # return a 200 code to the client (since the reply saved ok)
        if (googleResponseCode != Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK):
                DataCollector.UpdateURLHit(hitID=securityProperties.hitID, 
                                   responseCode=Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK,
                                   messageCode=Const.DataCollection.MessageCodes.UploadReply.GCM_BROADCAST_FAILED)
                       
                return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK,
                                                            Const.DataCollection.MessageCodes.UploadReply.GCM_BROADCAST_FAILED)
        
        
        # log and return on success
        DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                    responseCode=Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK, 
                                    messageCode=Const.DataCollection.MessageCodes.UploadReply.POST_SUCCESSFUL) 
        
        return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.Success.CODE_OK, 
                                                    Const.DataCollection.MessageCodes.UploadReply.POST_SUCCESSFUL)
    
    except Exception as e:
        DataCollector.logServerError(e)
        DataCollector.UpdateURLHit(hitID=securityProperties.hitID,
                                    responseCode=Const.HttpResponseFactory.ResponseCodes.ServerError.CODE_INTERNAL_SERVER_ERROR, 
                                    messageCode=Const.DataCollection.MessageCodes.UploadReply.POST_FAILED_SERVER_ERROR)  
        
        return HttpResponseFactory.MakeHttpResponse(Const.HttpResponseFactory.ResponseCodes.ServerError.CODE_INTERNAL_SERVER_ERROR, 
                                                    Const.DataCollection.MessageCodes.UploadReply.POST_FAILED_SERVER_ERROR)