Skip to content

Commit

Permalink
fix(wps): responding with 303 redirect to asynchronous WPS job submis…
Browse files Browse the repository at this point in the history
…sion

It is not possible to properly generate the first status ACCEPTED response.
  • Loading branch information
pacesm committed Feb 18, 2025
1 parent 8a0efde commit 94b9895
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions eoxserver/services/ows/wps/v10/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#-------------------------------------------------------------------------------

from logging import getLogger

from django.http.response import HttpResponseRedirectBase
from eoxserver.core.util.multiparttools import parse_multipart_related
from eoxserver.services.ows.wps.interfaces import (
ProcessInterface, AsyncBackendInterface,
Expand Down Expand Up @@ -58,6 +58,10 @@
DEFAULT_CONTENT_TYPE = "application/xml"


class HttpResponseSeeOther(HttpResponseRedirectBase):
status_code = 303


class WPS10ExecuteHandler(object):
""" WPS 1.0 Execute service handler. """

Expand Down Expand Up @@ -152,9 +156,12 @@ def handle(self, request):
request=request,
)

# Redirect to the new response XML generated by the backend.
return HttpResponseSeeOther(async_backend.get_response_url(job_id))

# encode the StatusAccepted response
encoder.status_location = async_backend.get_response_url(job_id)
response = encoder.encode_accepted()
#encoder.status_location = async_backend.get_response_url(job_id)
#response = encoder.encode_accepted()

else:
# synchronous execution
Expand Down

0 comments on commit 94b9895

Please sign in to comment.