Loading rpc/views.py +8 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,13 @@ def _join_parts( def _get_user_from_request(request: HttpRequest) -> Union[User, None]: """ Tries to find a user given the request. In this order: - try to find session user - try to find user associated with X-api-key header - try to find user corresponding to Authorization header """ if request.user.is_authenticated: return request.user if "X-Api-Key" in request.headers: Loading Loading @@ -225,6 +232,7 @@ def upload_partial(request: HttpRequest) -> HttpResponse: except KeyError: # Content-length header is mandatory return HttpResponse("Length Required", status=411) # All chunks are complete, time to assemble if len(glob("{}/{}-*.part".format(partials_dir, total_chunks))) == int( total_chunks ): Loading Loading
rpc/views.py +8 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,13 @@ def _join_parts( def _get_user_from_request(request: HttpRequest) -> Union[User, None]: """ Tries to find a user given the request. In this order: - try to find session user - try to find user associated with X-api-key header - try to find user corresponding to Authorization header """ if request.user.is_authenticated: return request.user if "X-Api-Key" in request.headers: Loading Loading @@ -225,6 +232,7 @@ def upload_partial(request: HttpRequest) -> HttpResponse: except KeyError: # Content-length header is mandatory return HttpResponse("Length Required", status=411) # All chunks are complete, time to assemble if len(glob("{}/{}-*.part".format(partials_dir, total_chunks))) == int( total_chunks ): Loading