-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limited upload size #10
Conversation
hey @SAMAD101 test's are failing could you please check. |
sure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason of failing test cases is that you forgot to add return statement in
@app.get("/paste/{uuid}")
def post_as_a_text(uuid):
...
cc @SAMAD101 |
The corrected function is: @app.get("/paste/{uuid}")
def post_as_a_text(uuid):
path = f"data/{uuid}"
text = ""
try:
with open(path, 'rb') as f:
text = f.read()
if sys.getsizeof(text) > MAX_UPLOAD_SIZE:
raise HTTPException(detail="File size is too large",
status_code=status.HTTP_413_REQUEST_ENTITY_TOO_LARGE)
else:
return PlainTextResponse(text)
except Exception as e:
print(e)
raise HTTPException(detail="404: The Requested Resource is not found",
status_code=status.HTTP_404_NOT_FOUND) |
Co-authored-by: A91y <[email protected]>
makes sense |
thanks |
@SAMAD101 Could you add a test for it [ which fails ]. |
Also Please update this branch to latest main [ head ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests for it and sync with the main
head
@Mr-Sunglasses the test that were failing, now passes. I think we are good to go |
Co-authored-by: Kanishk Pachauri <[email protected]>
Co-authored-by: Kanishk Pachauri <[email protected]>
Co-authored-by: Kanishk Pachauri <[email protected]>
Why it is failing because of rate limiter :( |
@SAMAD101 just do one thing close this PR and open a new fresh one, also write tests to check for Limited upload size. |
addressed in #5