# HG changeset patch # User drewp # Date 1580719853 28800 # Node ID d8eba5a51c1f59c578cf0ed875f6adc96f05a18a # Parent 040e5c578fc1d448f210cb6f8d366cab49887d25 try a text/plain response if we think it's a browser asking for the graph Ignore-this: 3ab9e0c28cd46aff6d93e818a8a5fbbd darcs-hash:43107cfc2041fb2a1652265c072aa35c945e129f diff -r 040e5c578fc1 -r d8eba5a51c1f lib/patchablegraph/patchablegraph.py --- a/lib/patchablegraph/patchablegraph.py Sun Feb 02 14:44:42 2020 -0800 +++ b/lib/patchablegraph/patchablegraph.py Mon Feb 03 00:50:53 2020 -0800 @@ -43,6 +43,15 @@ req.set_header('Content-type', 'application/ld+json') graph.serialize(req, format='json-ld', indent=2) else: + print(f'acceptHeader {acceptHeader}') + if acceptHeader.startswith('text/html'): + # browser; should arrange to pick live view + req.set_header('Content-type', 'text/plain') + lines = graph.serialize(format='nquads') + lines.sort() + req.write(''.join(lines)) + return + req.set_header('Content-type', 'application/x-trig') graph.serialize(req, format='trig')