Skip to content
Snippets Groups Projects
Commit 15d09b23 authored by Jean-Baptiste's avatar Jean-Baptiste
Browse files

Merge branch '83-location-header' into 'master'

Resolve "created resource url must be returned in reponse `location` header"

Closes #83

See merge request startinblox/djangoldp-packages/djangoldp!22
parents fdf8be30 0de817ee
No related branches found
No related tags found
1 merge request!22Resolve "created resource url must be returned in reponse `location` header"
Pipeline #734 passed
......@@ -138,6 +138,9 @@ class LDPViewSet(LDPViewSetGenerator):
response["Access-Control-Allow-Headers"] = "Content-Type, if-match"
response["Access-Control-Allow-Credentials"] = 'true'
response["Accept-Post"] = "application/ld+json"
if response.status_code == 201 and '@id' in response.data:
response["Location"] = response.data['@id']
response["Accept-Post"] = "application/ld+json"
return response
def update(self, request, *args, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment