Skip to content

Commit 515c519

Browse files
committed
Don't automatically add Content-Type on POSTs if not explicitly provided.
1 parent 23fb231 commit 515c519

File tree

5 files changed

+7
-579
lines changed

5 files changed

+7
-579
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# Builds manifests
22
task default: [:jsonld, :ttl, :html]
33

4+
desc "Create manifest.jsonld"
45
task jsonld: "gen_manifest.rb" do
56
%x(ruby gen_manifest.rb -o manifest.jsonld)
67
end
78

9+
desc "Create manifest.ttl"
810
task ttl: "gen_manifest.rb" do
911
%x(ruby gen_manifest.rb --format ttl -o manifest.ttl)
1012
end
1113

14+
desc "Create index.html"
1215
task html: "gen_manifest.rb" do
1316
%x(ruby gen_manifest.rb --format html -o index.html)
1417
end

sparql11/data-sparql11/protocol/gen_manifest.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,8 +744,8 @@ def gen_entry(frag, params)
744744
req[:Accept]
745745

746746
# Default Content-Type on POST
747-
req[:'Content-Type'] = "application/x-www-form-urlencoded" if
748-
req[:method] == :POST && !req.key?(:'Content-Type')
747+
#req[:'Content-Type'] = "application/x-www-form-urlencoded" if
748+
# req[:method] == :POST && !req.key?(:'Content-Type')
749749

750750
(request[:headers] ||= []) << encode_header(req, :'Content-Type') if
751751
req[:'Content-Type']

sparql11/data-sparql11/protocol/index.html

Lines changed: 2 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,7 @@ <h4>Request</h4>
186186
<span property='ht:absolutePath'>/sparql?query=ASK%20%7B%7D&amp;default-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata0.rdf</span>
187187
HTTP/<span property='ht:absolutePath'>1.1</span><br>
188188
<span>Host: www.example</span>
189-
<br>
190-
<span inlist property='ht:headers'>
191-
<div typeof='ht:RequestHeader'>
192-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
193-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
194-
</span>
195-
</div>
196-
</span></code>
189+
<br></code>
197190
</div>
198191
<div typeof='ht:Response'>
199192
<h4>Response</h4>
@@ -312,13 +305,6 @@ <h4>Request</h4>
312305
HTTP/<span property='ht:absolutePath'>1.1</span><br>
313306
<span>Host: www.example</span>
314307
<br>
315-
<span inlist property='ht:headers'>
316-
<div typeof='ht:RequestHeader'>
317-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
318-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
319-
</span>
320-
</div>
321-
</span>
322308
<br>
323309
<div property='ht:body' typeof='cnt:ContentAsText'>
324310
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -430,13 +416,6 @@ <h4>Request</h4>
430416
HTTP/<span property='ht:absolutePath'>1.1</span><br>
431417
<span>Host: www.example</span>
432418
<br>
433-
<span inlist property='ht:headers'>
434-
<div typeof='ht:RequestHeader'>
435-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
436-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
437-
</span>
438-
</div>
439-
</span>
440419
<br>
441420
<div property='ht:body' typeof='cnt:ContentAsText'>
442421
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -495,13 +474,6 @@ <h4>Request</h4>
495474
HTTP/<span property='ht:absolutePath'>1.1</span><br>
496475
<span>Host: www.example</span>
497476
<br>
498-
<span inlist property='ht:headers'>
499-
<div typeof='ht:RequestHeader'>
500-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
501-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
502-
</span>
503-
</div>
504-
</span>
505477
<br>
506478
<div property='ht:body' typeof='cnt:ContentAsText'>
507479
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -613,13 +585,6 @@ <h4>Request</h4>
613585
HTTP/<span property='ht:absolutePath'>1.1</span><br>
614586
<span>Host: www.example</span>
615587
<br>
616-
<span inlist property='ht:headers'>
617-
<div typeof='ht:RequestHeader'>
618-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
619-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
620-
</span>
621-
</div>
622-
</span>
623588
<br>
624589
<div property='ht:body' typeof='cnt:ContentAsText'>
625590
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -678,13 +643,6 @@ <h4>Request</h4>
678643
HTTP/<span property='ht:absolutePath'>1.1</span><br>
679644
<span>Host: www.example</span>
680645
<br>
681-
<span inlist property='ht:headers'>
682-
<div typeof='ht:RequestHeader'>
683-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
684-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
685-
</span>
686-
</div>
687-
</span>
688646
<br>
689647
<div property='ht:body' typeof='cnt:ContentAsText'>
690648
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -743,13 +701,6 @@ <h4>Request</h4>
743701
HTTP/<span property='ht:absolutePath'>1.1</span><br>
744702
<span>Host: www.example</span>
745703
<br>
746-
<span inlist property='ht:headers'>
747-
<div typeof='ht:RequestHeader'>
748-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
749-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
750-
</span>
751-
</div>
752-
</span>
753704
<br>
754705
<div property='ht:body' typeof='cnt:ContentAsText'>
755706
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -807,13 +758,6 @@ <h4>Request</h4>
807758
HTTP/<span property='ht:absolutePath'>1.1</span><br>
808759
<span>Host: www.example</span>
809760
<br>
810-
<span inlist property='ht:headers'>
811-
<div typeof='ht:RequestHeader'>
812-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
813-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
814-
</span>
815-
</div>
816-
</span>
817761
<br>
818762
<div property='ht:body' typeof='cnt:ContentAsText'>
819763
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -867,13 +811,6 @@ <h4>Request</h4>
867811
HTTP/<span property='ht:absolutePath'>1.1</span><br>
868812
<span>Host: www.example</span>
869813
<br>
870-
<span inlist property='ht:headers'>
871-
<div typeof='ht:RequestHeader'>
872-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
873-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
874-
</span>
875-
</div>
876-
</span>
877814
<br>
878815
<div property='ht:body' typeof='cnt:ContentAsText'>
879816
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -933,13 +870,6 @@ <h4>Request</h4>
933870
HTTP/<span property='ht:absolutePath'>1.1</span><br>
934871
<span>Host: www.example</span>
935872
<br>
936-
<span inlist property='ht:headers'>
937-
<div typeof='ht:RequestHeader'>
938-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
939-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
940-
</span>
941-
</div>
942-
</span>
943873
<br>
944874
<div property='ht:body' typeof='cnt:ContentAsText'>
945875
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -999,13 +929,6 @@ <h4>Request</h4>
999929
HTTP/<span property='ht:absolutePath'>1.1</span><br>
1000930
<span>Host: www.example</span>
1001931
<br>
1002-
<span inlist property='ht:headers'>
1003-
<div typeof='ht:RequestHeader'>
1004-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
1005-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
1006-
</span>
1007-
</div>
1008-
</span>
1009932
<br>
1010933
<div property='ht:body' typeof='cnt:ContentAsText'>
1011934
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -1100,13 +1023,6 @@ <h4>Request</h4>
11001023
HTTP/<span property='ht:absolutePath'>1.1</span><br>
11011024
<span>Host: www.example</span>
11021025
<br>
1103-
<span inlist property='ht:headers'>
1104-
<div typeof='ht:RequestHeader'>
1105-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
1106-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
1107-
</span>
1108-
</div>
1109-
</span>
11101026
<br>
11111027
<div property='ht:body' typeof='cnt:ContentAsText'>
11121028
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -1207,13 +1123,6 @@ <h4>Request</h4>
12071123
HTTP/<span property='ht:absolutePath'>1.1</span><br>
12081124
<span>Host: www.example</span>
12091125
<br>
1210-
<span inlist property='ht:headers'>
1211-
<div typeof='ht:RequestHeader'>
1212-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
1213-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
1214-
</span>
1215-
</div>
1216-
</span>
12171126
<br>
12181127
<div property='ht:body' typeof='cnt:ContentAsText'>
12191128
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -1313,14 +1222,7 @@ <h4>Request</h4>
13131222
<span property='ht:absolutePath'>/sparql?update=%0APREFIX%20dc%3A%20%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX%20foaf%3A%20%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0ADROP%20ALL%20%3B%0AINSERT%20DATA%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20%7B%20%3Chttp%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata3.rdf%3E%20a%20foaf%3ADocument%20%7D%0A%7D%20%3B%0AINSERT%20%7B%0A%20%20GRAPH%20%3Chttp%3A%2F%2Fexample.org%2Fprotocol-update-dataset-full-test%2F%3E%20%7B%0A%20%20%20%20%3Fs%20%3Chttp%3A%2F%2Fexample.org%2Fin%3E%20%3Fin%0A%20%20%7D%0A%7D%0AWHERE%20%7B%0A%20%20%7B%0A%20%20%20%20GRAPH%20%3Fg%20%7B%20%3Fs%20a%20foaf%3ADocument%20%7D%0A%20%20%20%20BIND%28%3Fg%20AS%20%3Fin%29%0A%20%20%7D%0A%20%20UNION%0A%20%20%7B%0A%20%20%20%20%3Fs%20a%20foaf%3ADocument%20.%0A%20%20%20%20BIND%28%22default%22%20AS%20%3Fin%29%0A%20%20%7D%0A%7D%0A&amp;using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata1.rdf&amp;using-graph-uri=http%3A%2F%2Fkasei.us%2F2009%2F09%2Fsparql%2Fdata%2Fdata2.rdf</span>
13141223
HTTP/<span property='ht:absolutePath'>1.1</span><br>
13151224
<span>Host: www.example</span>
1316-
<br>
1317-
<span inlist property='ht:headers'>
1318-
<div typeof='ht:RequestHeader'>
1319-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
1320-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
1321-
</span>
1322-
</div>
1323-
</span></code>
1225+
<br></code>
13241226
</div>
13251227
<div typeof='ht:Response'>
13261228
<h4>Response</h4>
@@ -1416,13 +1318,6 @@ <h4>Request</h4>
14161318
HTTP/<span property='ht:absolutePath'>1.1</span><br>
14171319
<span>Host: www.example</span>
14181320
<br>
1419-
<span inlist property='ht:headers'>
1420-
<div typeof='ht:RequestHeader'>
1421-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
1422-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
1423-
</span>
1424-
</div>
1425-
</span>
14261321
<br>
14271322
<div property='ht:body' typeof='cnt:ContentAsText'>
14281323
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -1518,13 +1413,6 @@ <h4>Request</h4>
15181413
HTTP/<span property='ht:absolutePath'>1.1</span><br>
15191414
<span>Host: www.example</span>
15201415
<br>
1521-
<span inlist property='ht:headers'>
1522-
<div typeof='ht:RequestHeader'>
1523-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
1524-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
1525-
</span>
1526-
</div>
1527-
</span>
15281416
<br>
15291417
<div property='ht:body' typeof='cnt:ContentAsText'>
15301418
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -1556,11 +1444,6 @@ <h4>Request</h4>
15561444
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/sparql-results+xml</span></span>
15571445
</span>
15581446
</div>
1559-
<div typeof='ht:RequestHeader'>
1560-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
1561-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
1562-
</span>
1563-
</div>
15641447
</span>
15651448
<br>
15661449
<div property='ht:body' typeof='cnt:ContentAsText'>
@@ -1787,13 +1670,6 @@ <h4>Request</h4>
17871670
HTTP/<span property='ht:absolutePath'>1.1</span><br>
17881671
<span>Host: www.example</span>
17891672
<br>
1790-
<span inlist property='ht:headers'>
1791-
<div typeof='ht:RequestHeader'>
1792-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
1793-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
1794-
</span>
1795-
</div>
1796-
</span>
17971673
<br>
17981674
<div property='ht:body' typeof='cnt:ContentAsText'>
17991675
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -1964,13 +1840,6 @@ <h4>Request</h4>
19641840
HTTP/<span property='ht:absolutePath'>1.1</span><br>
19651841
<span>Host: www.example</span>
19661842
<br>
1967-
<span inlist property='ht:headers'>
1968-
<div typeof='ht:RequestHeader'>
1969-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
1970-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
1971-
</span>
1972-
</div>
1973-
</span>
19741843
<br>
19751844
<div property='ht:body' typeof='cnt:ContentAsText'>
19761845
<meta property='cnt:characterEncoding' value='UTF-8'>
@@ -2158,13 +2027,6 @@ <h4>Request</h4>
21582027
HTTP/<span property='ht:absolutePath'>1.1</span><br>
21592028
<span>Host: www.example</span>
21602029
<br>
2161-
<span inlist property='ht:headers'>
2162-
<div typeof='ht:RequestHeader'>
2163-
<meta property='ht:fieldValue' value='application/x-www-form-urlencoded'><span property='ht:fieldName'>Content-Type</span>: <span inlist property='ht:headerElements'>
2164-
<span typeof='ht:HeaderElement'><span property='ht:elementName'>application/x-www-form-urlencoded</span></span>
2165-
</span>
2166-
</div>
2167-
</span>
21682030
<br>
21692031
<div property='ht:body' typeof='cnt:ContentAsText'>
21702032
<meta property='cnt:characterEncoding' value='UTF-8'>

0 commit comments

Comments
 (0)