From 76c5b9d6543105d8f1e86144e56706c8a29369a9 Mon Sep 17 00:00:00 2001 From: cjshaw <4930129+cjshawMIT@users.noreply.github.com> Date: Wed, 28 Mar 2018 11:28:11 -0400 Subject: [PATCH] better regex for ids with trailing slash in URL --- assessment/assessment.py | 18 +++++++++--------- logging_/logging_.py | 4 ++-- repository/repository.py | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/assessment/assessment.py b/assessment/assessment.py index fb6e1d9..14a67ff 100644 --- a/assessment/assessment.py +++ b/assessment/assessment.py @@ -103,29 +103,29 @@ "/banks/(.*)/assessmentstaken/(.*)/questions/(.*)/qti/?", "AssessmentTakenQuestionQTIDetails", "/banks/(.*)/assessmentstaken/(.*)/questions/(.*)/status/?", "AssessmentTakenQuestionStatus", "/banks/(.*)/assessmentstaken/(.*)/questions/(.*)/submit/?", "AssessmentTakenQuestionSubmit", - "/banks/(.*)/assessmentstaken/(.*)/questions/(.*)/?", "AssessmentTakenQuestionDetails", + "/banks/(.*)/assessmentstaken/(.*)/questions/(.*[^/])/?", "AssessmentTakenQuestionDetails", "/banks/(.*)/assessmentstaken/(.*)/questions/?", "AssessmentTakenQuestions", "/banks/(.*)/assessmentstaken/(.*)/finish/?", "FinishAssessmentTaken", - "/banks/(.*)/assessmentstaken/(.*)/?", "AssessmentTakenDetails", + "/banks/(.*)/assessmentstaken/(.*[^/])/?", "AssessmentTakenDetails", "/banks/(.*)/assessments/(.*)/assessmentsoffered/?", "AssessmentsOffered", "/banks/(.*)/assessmentsoffered/?", "AssessmentsOffered", - "/banks/(.*)/assessmentsoffered/(.*)/?", "AssessmentOfferedDetails", - "/banks/(.*)/assessments/(.*)/assignedbankids/(.*)/?", "AssessmentRemoveAssignedBankIds", + "/banks/(.*)/assessmentsoffered/(.*[^/])/?", "AssessmentOfferedDetails", + "/banks/(.*)/assessments/(.*)/assignedbankids/(.*[^/])/?", "AssessmentRemoveAssignedBankIds", "/banks/(.*)/assessments/(.*)/assignedbankids/?", "AssessmentAssignedBankIds", - "/banks/(.*)/assessments/(.*)/items/(.*)/?", "AssessmentItemDetails", + "/banks/(.*)/assessments/(.*)/items/(.*[^/])/?", "AssessmentItemDetails", "/banks/(.*)/assessments/(.*)/items/?", "AssessmentItemsList", - "/banks/(.*)/assessments/(.*)/?", "AssessmentDetails", + "/banks/(.*)/assessments/(.*[^/])/?", "AssessmentDetails", "/banks/(.*)/assessments/?", "AssessmentsList", "/banks/(.*)/items/(.*)/videoreplacement/?", "ItemVideoTagReplacement", "/banks/(.*)/items/(.*)/qti/?", "ItemQTIDetails", - "/banks/(.*)/items/(.*)/?", "ItemDetails", + "/banks/(.*)/items/(.*[^/])/?", "ItemDetails", "/banks/(.*)/items/?", "ItemsList", "/banks/(.*)/?", "AssessmentBankDetails", "/banks/?", "AssessmentBanksList", - "/hierarchies/roots/(.*)/?", "AssessmentHierarchiesRootDetails", + "/hierarchies/roots/(.*[^/])/?", "AssessmentHierarchiesRootDetails", "/hierarchies/roots/?", "AssessmentHierarchiesRootsList", "/hierarchies/nodes/(.*)/children/?", "AssessmentHierarchiesNodeChildrenList", - "/hierarchies/nodes/(.*)/?", "AssessmentHierarchiesNodeDetails" + "/hierarchies/nodes/(.*[^/])/?", "AssessmentHierarchiesNodeDetails" ) diff --git a/logging_/logging_.py b/logging_/logging_.py index f52106c..667d2ac 100644 --- a/logging_/logging_.py +++ b/logging_/logging_.py @@ -18,9 +18,9 @@ urls = ( "/logs/?", "LogsList", - "/logs/(.*)/logentries/(.*)/?", "LogEntryDetails", + "/logs/(.*)/logentries/(.*[^/])/?", "LogEntryDetails", "/logs/(.*)/logentries/?", "LogEntriesList", - "/logs/(.*)/?", "LogDetails", + "/logs/(.*[^/])/?", "LogDetails", "/genericlog/?", "GenericLogEntries" ) diff --git a/repository/repository.py b/repository/repository.py index 54513f1..8fd0096 100644 --- a/repository/repository.py +++ b/repository/repository.py @@ -15,11 +15,11 @@ urls = ( "/repositories/(.*)/assets/(.*)/contents/(.*)/stream/?", "AssetContentStream", - "/repositories/(.*)/assets/(.*)/contents/(.*)/?", "AssetContentDetails", + "/repositories/(.*)/assets/(.*)/contents/(.*[^/])/?", "AssetContentDetails", "/repositories/(.*)/assets/(.*)/contents/?", "AssetContentsList", - "/repositories/(.*)/assets/(.*)/?", "AssetDetails", + "/repositories/(.*)/assets/(.*[^/])/?", "AssetDetails", "/repositories/(.*)/assets/?", "AssetsList", - "/repositories/(.*)/?", "RepositoryDetails", + "/repositories/(.*[^/])/?", "RepositoryDetails", "/repositories/?", "RepositoriesList" )