Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
b0e2c82a
Commit
b0e2c82a
authored
Mar 26, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actually.. return a 400 rather than a 404 because the request is malformed. Also add unit test.
parent
a44ecdfc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
cms/djangoapps/contentstore/tests/test_contentstore.py
+4
-0
common/djangoapps/contentserver/middleware.py
+2
-1
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
b0e2c82a
...
...
@@ -213,6 +213,10 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
resp
=
self
.
client
.
get
(
reverse
(
'edit_unit'
,
kwargs
=
{
'location'
:
new_loc
.
url
()}))
self
.
assertEqual
(
resp
.
status_code
,
200
)
def
test_bad_contentstore_request
(
self
):
resp
=
self
.
client
.
get
(
'http://localhost:8001/c4x/CDX/123123/asset/&images_circuits_Lab7Solution2.png'
)
self
.
assertEqual
(
resp
.
status_code
,
400
)
def
test_delete_course
(
self
):
import_from_xml
(
modulestore
(),
'common/test/data/'
,
[
'full'
])
...
...
common/djangoapps/contentserver/middleware.py
View file @
b0e2c82a
...
...
@@ -17,8 +17,9 @@ class StaticContentServer(object):
try
:
loc
=
StaticContent
.
get_location_from_path
(
request
.
path
)
except
InvalidLocationError
:
# return a 'Bad Request' to browser as we have a malformed Location
response
=
HttpResponse
()
response
.
status_code
=
40
4
response
.
status_code
=
40
0
return
response
# first look in our cache so we don't have to round-trip to the DB
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment