Skip to content

Commit

Permalink
Merge pull request #33 from BandwidthOnDemand/fix_get_discovery_inter…
Browse files Browse the repository at this point in the history
…nal_server_error

an http request should return bytes
  • Loading branch information
JohannesGarm authored Nov 26, 2021
2 parents a2df2a9 + 241daf9 commit f4936ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opennsa/shared/modifiableresource.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def render_GET(self, request):
if self.representation is None:
# we haven't been given a representation yet
request.setResponseCode(500)
return 'Resource has not yet been created/updated.'
return b'Resource has not yet been created/updated.'

# check for if-modified-since header, and send 304 back if it is not been modified
msd_header = request.getHeader(IF_MODIFIED_SINCE)
Expand All @@ -55,7 +55,7 @@ def render_GET(self, request):
msd = datetime.datetime.strptime(msd_header, RFC850_FORMAT)
if msd >= self.last_update_time:
request.setResponseCode(304)
return ''
return b''
except ValueError:
pass # error parsing timestamp

Expand Down

0 comments on commit f4936ab

Please sign in to comment.