Skip to content

Commit

Permalink
Merge pull request #8 from avantifellows/support_for_url_encoded_params
Browse files Browse the repository at this point in the history
added url decoding of incoming params
  • Loading branch information
deepansh96 authored Oct 8, 2022
2 parents 2e9bdf3 + daa83b0 commit 641e8b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/routers/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from fastapi.templating import Jinja2Templates
from fastapi import HTTPException
from collections import OrderedDict
from urllib.parse import unquote

from models.student_quiz_report import StudentQuizReportController

Expand Down Expand Up @@ -46,6 +47,10 @@ def student_quiz_report(request: Request, session_id: str, user_id: str):
status_code=400,
detail="Session ID and User ID have to be specified",
)
# decoding URL encoded values. As this information is coming through a URL,
# it's possible that the strings are URL encoded.
session_id = unquote(session_id)
user_id = unquote(user_id)
try:
data = self.__student_quiz_reports_controller.get_student_quiz_report(
session_id=session_id, user_id=user_id
Expand Down

0 comments on commit 641e8b9

Please sign in to comment.