w3c_validators 1.3 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +13 -5
- data/.gitignore +2 -1
- data/CHANGELOG +8 -1
- data/README.md +48 -25
- data/lib/w3c_validators/feed_validator.rb +9 -3
- data/lib/w3c_validators/nu_validator.rb +4 -2
- data/lib/w3c_validators/validator.rb +32 -13
- data/lib/w3c_validators/version.rb +1 -1
- data/test/http_recording/feed_validating_uri_with_soap.yml +5 -5
- data/test/http_recording/html5_getting_request_data.yml +4 -4
- data/test/http_recording/html5_validating_file.yml +78 -0
- data/test/http_recording/html5_validating_text.yml +87 -0
- data/test/http_recording/html5_validating_text_via_file.yml +78 -0
- data/test/http_recording/html5_validating_uri.yml +27 -27
- data/test/http_recording/markup_debugging_uri.yml +3 -3
- data/test/http_recording/markup_overriding_charset.yml +1 -1
- data/test/http_recording/markup_overriding_charset_for_fallback_only.yml +3 -3
- data/test/http_recording/markup_overriding_doctype.yml +8 -8
- data/test/http_recording/markup_overriding_doctype_for_fallback_only.yml +3 -3
- data/test/http_recording/markup_validating_uri_with_head_request.yml +1 -1
- data/test/http_recording/markup_validating_uri_with_soap.yml +3 -3
- data/test/http_recording/markup_validator_abort.yml +1 -1
- data/test/http_recording/markup_validator_contains_details_of_error_conditions.yml +3 -3
- data/test/http_recording/markup_validator_html5_redirect.yml +101 -0
- data/test/test_feed_validator.rb +1 -1
- data/test/test_html5_validator.rb +27 -13
- data/test/test_markup_validator.rb +9 -9
- data/test/test_proxy.rb +1 -1
- data/test/tools/curl_nu.sh +12 -0
- metadata +23 -19
- data/Gemfile.lock +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YWFjNTU0OWFlMTA4ZGZlYTliNjRkYWE0MjE2ZjQ1N2RjMjA4ODU4OA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YTQwZjFlNWI4MWViYzhlZmQwYmY5ZmUxODJhMTU0YjJlZmUyN2I0NA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NjY2OGFjOTAwNmNiNGFmNGFhMTNkMWY4MWNmNzViYzU4ZTRhYmUyNzkyYzYw
|
10
|
+
YTFjMDI5NWZjZGU3ZTUyOTc3NDcwZTFlNWI1OWRkNjZlOTE3OTFlY2Y4OTY0
|
11
|
+
OWJhOTVhZWU5NWMwY2VlNGI2OTM5NmQyYTA1MjZjNGU3ZGVlYjU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTE1OGJhNzhhYWYwYTNjOGEyYThkMmZhZTU1Nzg5ODFlNWYzNGNhZGJhMWNk
|
14
|
+
Nzk5MDRlYzRhYWE4NWE5Zjk3N2U1Njg0MDY0MGE5MDJlZjY2OGI1NzdmZmY1
|
15
|
+
ZjhmYWI2NmViMzViYjBiNGU0ZjliNmVmOGQwY2Y4MGExMGZkNzI=
|
data/.gitignore
CHANGED
data/CHANGELOG
CHANGED
@@ -35,7 +35,7 @@
|
|
35
35
|
* Use CSS3 as default profile
|
36
36
|
* Use Bundler and update to new RDoc command
|
37
37
|
|
38
|
-
== Version 1.3
|
38
|
+
== Version 1.3
|
39
39
|
* drop ruby 1.9 compatibility
|
40
40
|
* Move markup and nu validators to https
|
41
41
|
* Use POST for file validation (avoid crash for big files)
|
@@ -47,3 +47,10 @@
|
|
47
47
|
* Add capability to manage vendor extension as warning or error
|
48
48
|
* Activate travis-ci build
|
49
49
|
|
50
|
+
== Version 1.3.1
|
51
|
+
* Fix file validation in NuValidator
|
52
|
+
* Fix issue in getting error line with NuValidator
|
53
|
+
* update README to indicate NuValidator is the preferred HTML checker
|
54
|
+
* update gemspec
|
55
|
+
* update test to point to project gh-pages
|
56
|
+
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
W3C Validators is a Ruby wrapper for the World Wide Web Consortium's online
|
5
5
|
validation services.
|
6
6
|
|
7
|
-
It supports the
|
7
|
+
It supports the nu validator, the feed validator and the CSS validator.
|
8
8
|
|
9
9
|
### Installation
|
10
10
|
|
@@ -14,9 +14,14 @@ It supports the markup validator, the feed validator and the CSS validator.
|
|
14
14
|
|
15
15
|
### Usage
|
16
16
|
|
17
|
-
There are three main validator classes available, the `W3CValidators::
|
17
|
+
There are three main validator classes available, the `W3CValidators::NuValidator`
|
18
18
|
(used for HTML), the `W3CValidators::FeedValidator` and the `W3CValidators::CSSValidator`.
|
19
19
|
|
20
|
+
**Warning**: The `W3CValidators::MarkupValidator` also exist but is not anymore the preferred
|
21
|
+
way to check HTML document. Indeed, it is working fine for non-HTML5 documents,
|
22
|
+
but it is broken when you test an HTML5 document due to W3C redirection. `W3CValidators::NuValidator`
|
23
|
+
should be used instead for standard cases.
|
24
|
+
|
20
25
|
Each validator has offers three different validation methods.
|
21
26
|
|
22
27
|
* `validate_text` methods take a string
|
@@ -33,7 +38,7 @@ Each of the three validators allows you to specify a custom path to the
|
|
33
38
|
validator. You can set your own validator like this:
|
34
39
|
|
35
40
|
```ruby
|
36
|
-
validator =
|
41
|
+
validator = NuValidator.new(:validator_uri => 'http://localhost/check')
|
37
42
|
```
|
38
43
|
|
39
44
|
#### Using a proxy server
|
@@ -41,30 +46,24 @@ validator. You can set your own validator like this:
|
|
41
46
|
You can use a proxy server by passing in its information in the contructor.
|
42
47
|
|
43
48
|
```ruby
|
44
|
-
validator =
|
45
|
-
|
46
|
-
|
47
|
-
|
49
|
+
validator = NuValidator.new(:proxy_host => 'proxy.example.com',
|
50
|
+
:proxy_port => 80,
|
51
|
+
:proxy_user => 'optional',
|
52
|
+
:proxy_pass => 'optional')
|
48
53
|
```
|
49
54
|
|
50
55
|
### Examples
|
51
56
|
|
52
|
-
#### Example #1:
|
57
|
+
#### Example #1: Nu validator, local file
|
53
58
|
|
54
59
|
```ruby
|
55
60
|
require 'w3c_validators'
|
56
61
|
|
57
62
|
include W3CValidators
|
58
63
|
|
59
|
-
@validator =
|
60
|
-
|
61
|
-
# override the DOCTYPE
|
62
|
-
@validator.set_doctype!(:html32)
|
64
|
+
@validator = NuValidator.new
|
63
65
|
|
64
|
-
|
65
|
-
@validator.set_debug!(true)
|
66
|
-
|
67
|
-
file = File.dirname(__FILE__) + '/fixtures/markup.html'
|
66
|
+
file = File.dirname(__FILE__) + '/fixtures/valid_html5.html'
|
68
67
|
results = @validator.validate_file(fp)
|
69
68
|
|
70
69
|
if results.errors.length > 0
|
@@ -74,12 +73,6 @@ You can use a proxy server by passing in its information in the contructor.
|
|
74
73
|
else
|
75
74
|
puts 'Valid!'
|
76
75
|
end
|
77
|
-
|
78
|
-
puts 'Debugging messages'
|
79
|
-
|
80
|
-
results.debug_messages.each do |key, value|
|
81
|
-
puts "#{key}: #{value}"
|
82
|
-
end
|
83
76
|
```
|
84
77
|
|
85
78
|
|
@@ -123,6 +116,38 @@ You can use a proxy server by passing in its information in the contructor.
|
|
123
116
|
end
|
124
117
|
```
|
125
118
|
|
119
|
+
#### Example #4: Markup validator, local file
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
require 'w3c_validators'
|
123
|
+
|
124
|
+
include W3CValidators
|
125
|
+
|
126
|
+
@validator = MarkupValidator.new
|
127
|
+
|
128
|
+
# override the DOCTYPE
|
129
|
+
@validator.set_doctype!(:html32)
|
130
|
+
|
131
|
+
# turn on debugging messages
|
132
|
+
@validator.set_debug!(true)
|
133
|
+
|
134
|
+
file = File.dirname(__FILE__) + '/fixtures/markup.html'
|
135
|
+
results = @validator.validate_file(fp)
|
136
|
+
|
137
|
+
if results.errors.length > 0
|
138
|
+
results.errors.each do |err|
|
139
|
+
puts err.to_s
|
140
|
+
end
|
141
|
+
else
|
142
|
+
puts 'Valid!'
|
143
|
+
end
|
144
|
+
|
145
|
+
puts 'Debugging messages'
|
146
|
+
|
147
|
+
results.debug_messages.each do |key, value|
|
148
|
+
puts "#{key}: #{value}"
|
149
|
+
end
|
150
|
+
```
|
126
151
|
### Tests
|
127
152
|
|
128
153
|
Run unit tests using <tt>rake test</tt>. Note that there is a one second delay
|
@@ -131,9 +156,7 @@ between each call to the W3C's validators per their request.
|
|
131
156
|
|
132
157
|
### Credits and code
|
133
158
|
|
134
|
-
|
135
|
-
|
136
|
-
Source is available on [GitHub](https://github.com/alexdunae/w3c-validators)
|
159
|
+
Source is available on [GitHub](https://github.com/w3c-validators/w3c_validators)
|
137
160
|
|
138
161
|
Written by Alex Dunae ([dunae.ca](http://dunae.ca/), e-mail 'code' at the same domain), 2007.
|
139
162
|
|
@@ -23,7 +23,7 @@ module W3CValidators
|
|
23
23
|
#
|
24
24
|
# Returns W3CValidators::Results.
|
25
25
|
def validate_uri(url)
|
26
|
-
return validate({:url => url}
|
26
|
+
return validate({:url => url})
|
27
27
|
end
|
28
28
|
|
29
29
|
# Validate a feed from a string.
|
@@ -49,9 +49,15 @@ module W3CValidators
|
|
49
49
|
end
|
50
50
|
|
51
51
|
protected
|
52
|
-
def validate(options
|
52
|
+
def validate(options) # :nodoc:
|
53
53
|
options = get_request_options(options)
|
54
|
-
|
54
|
+
if options.has_key? :url
|
55
|
+
response = send_request(options, :get)
|
56
|
+
else
|
57
|
+
# we force url_encode_mode
|
58
|
+
options.merge!( {:post => :url_encode} )
|
59
|
+
response = send_request(options, :post)
|
60
|
+
end
|
55
61
|
@results = parse_soap_response(response.body)
|
56
62
|
@results
|
57
63
|
end
|
@@ -57,7 +57,7 @@ module W3CValidators
|
|
57
57
|
file_path = file
|
58
58
|
end
|
59
59
|
|
60
|
-
return
|
60
|
+
return validate_text(src)
|
61
61
|
end
|
62
62
|
|
63
63
|
protected
|
@@ -67,6 +67,8 @@ protected
|
|
67
67
|
if options.has_key?(:doc)
|
68
68
|
response = send_request(options, :get)
|
69
69
|
else
|
70
|
+
# we force the file to be sent in the request body
|
71
|
+
options.merge!({:post => :body})
|
70
72
|
response = send_request(options, :post, false, :content)
|
71
73
|
end
|
72
74
|
|
@@ -129,7 +131,7 @@ protected
|
|
129
131
|
end
|
130
132
|
|
131
133
|
message_params = {
|
132
|
-
:line => msg['
|
134
|
+
:line => msg['lastLine'],
|
133
135
|
:col => msg['firstColumn'],
|
134
136
|
:message => msg['message'],
|
135
137
|
:source => msg['extract']
|
@@ -62,25 +62,44 @@ module W3CValidators
|
|
62
62
|
query = create_query_string_data(options)
|
63
63
|
response = http.get(@validator_uri.path + '?' + query)
|
64
64
|
when :post
|
65
|
-
|
66
|
-
if
|
67
|
-
|
68
|
-
|
69
|
-
|
65
|
+
path = nil
|
66
|
+
if options.has_key? :post
|
67
|
+
opt = options[:post]
|
68
|
+
options.delete(:post)
|
69
|
+
case opt
|
70
|
+
when :url_encode
|
71
|
+
path = @validator_uri.path
|
72
|
+
query = create_query_string_data(options)
|
73
|
+
header = nil
|
74
|
+
when :body
|
75
|
+
query = options[:content]
|
76
|
+
header = { "Content-type" => 'text/html; charset=utf-8' }
|
77
|
+
options.delete(:content)
|
78
|
+
else
|
79
|
+
raise ArgumentError, ":post specifier must be :url_encode or :body"
|
70
80
|
end
|
71
81
|
else
|
72
|
-
|
73
|
-
|
82
|
+
# send a multipart form request
|
83
|
+
if params_to_post
|
84
|
+
post = {}
|
85
|
+
[params_to_post].flatten.each do |param|
|
86
|
+
post[param] = options.delete(param)
|
87
|
+
end
|
88
|
+
else
|
89
|
+
post = options
|
90
|
+
options = {}
|
91
|
+
end
|
92
|
+
query, boundary = create_multipart_data(post)
|
93
|
+
header = { "Content-type" => "multipart/form-data; boundary=" + boundary }
|
94
|
+
|
74
95
|
end
|
75
96
|
|
76
97
|
qs = create_query_string_data(options)
|
77
98
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
query = create_query_string_data(options)
|
83
|
-
response = http.post2(@validator_uri.path, query)
|
99
|
+
if path.nil?
|
100
|
+
path = @validator_uri.path + '?' + qs
|
101
|
+
end
|
102
|
+
response = http.post2(path, query, header)
|
84
103
|
else
|
85
104
|
raise ArgumentError, "request_mode must be either :get, :head or :post"
|
86
105
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://validator.w3.org/feed/check.cgi?output=soap12&url=https://
|
5
|
+
uri: http://validator.w3.org/feed/check.cgi?output=soap12&url=https://w3c-validators.github.io/w3c_validators/invalid_feed.xml
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -19,7 +19,7 @@ http_interactions:
|
|
19
19
|
message: OK
|
20
20
|
headers:
|
21
21
|
Date:
|
22
|
-
- Sun,
|
22
|
+
- Sun, 18 Dec 2016 11:11:13 GMT
|
23
23
|
Server:
|
24
24
|
- Apache/2.4.10 (Debian)
|
25
25
|
Transfer-Encoding:
|
@@ -30,9 +30,9 @@ http_interactions:
|
|
30
30
|
encoding: UTF-8
|
31
31
|
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\">\n<env:Body>\n<m:feedvalidationresponse
|
32
32
|
env:encodingStyle=\"http://www.w3.org/2003/05/soap-encoding\" xmlns:m=\"http://www.w3.org/2005/10/feed-validator\">\n
|
33
|
-
\ <m:uri>https://
|
33
|
+
\ <m:uri>https://w3c-validators.github.io/w3c_validators/invalid_feed.xml</m:uri>
|
34
34
|
\n <m:checkedby>http://validator.w3.org/feed/check.cgi</m:checkedby>\n
|
35
|
-
\ <m:date>2016-
|
35
|
+
\ <m:date>2016-12-18T11:11:13.670365</m:date>\n <m:validity>false</m:validity>\n
|
36
36
|
\ <m:errors>\n <m:errorcount>1</m:errorcount>\n <m:errorlist><error>\n
|
37
37
|
\ <level>error</level>\n <type>MissingElement</type>\n <line>10</line>\n
|
38
38
|
\ <column>1</column>\n <text>Missing author element: name</text>\n <msgcount>1</msgcount>\n
|
@@ -46,5 +46,5 @@ http_interactions:
|
|
46
46
|
\ <m:informations>\n\t<m:infocount>0</m:infocount>\n\t<m:infolist></m:infolist>\n
|
47
47
|
\ </m:informations>\n</m:feedvalidationresponse>\n</env:Body>\n</env:Envelope>\n\n"
|
48
48
|
http_version:
|
49
|
-
recorded_at: Sun,
|
49
|
+
recorded_at: Sun, 18 Dec 2016 11:11:13 GMT
|
50
50
|
recorded_with: VCR 3.0.3
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://validator.nu/?doc=https://
|
5
|
+
uri: https://validator.nu/?doc=https://w3c-validators.github.io/w3c_validators/valid_html5.html&out=json&parser=html&showsource=yes
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -21,7 +21,7 @@ http_interactions:
|
|
21
21
|
Server:
|
22
22
|
- nginx/1.11.5
|
23
23
|
Date:
|
24
|
-
- Sun,
|
24
|
+
- Sun, 18 Dec 2016 11:03:30 GMT
|
25
25
|
Content-Type:
|
26
26
|
- application/json; charset=utf-8
|
27
27
|
Transfer-Encoding:
|
@@ -45,7 +45,7 @@ http_interactions:
|
|
45
45
|
body:
|
46
46
|
encoding: ASCII-8BIT
|
47
47
|
string: |
|
48
|
-
{"url":"https://
|
48
|
+
{"url":"https://w3c-validators.github.io/w3c_validators/valid_html5.html","messages":[],"source":{"type":"text/html","encoding":"utf-8","code":"<!DOCTYPE html>\n<html lang=\"en-ca\">\n <head>\n\t<meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">\n <title>HTML 5 Example</title>\n </head>\n <body>\n <p>This is a sample HTML 5 document.</p>\n <section>\n\t <h1>Example of paragraphs</h1>\n\t This is the <em>first</em> paragraph in this example.\n\t <p>This is the second.</p>\n\t <!-- This is not a paragraph. -->\n\t</section>\n </body>\n</html>"}}
|
49
49
|
http_version:
|
50
|
-
recorded_at: Sun,
|
50
|
+
recorded_at: Sun, 18 Dec 2016 11:03:30 GMT
|
51
51
|
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,78 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://validator.nu/?out=json&parser=html&showsource=yes
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: "<!DOCTYPE html>\n<html lang=\"en-ca\">\n <head>\n <!--<meta http-equiv=\"Content-type\"
|
9
|
+
content=\"text/html; charset=iso-8859-1\">-->\n <title>HTML 5 Example</title>\n
|
10
|
+
\ </head>\n <body>\n \t<!-- should have one error (missing </section>) and
|
11
|
+
one warning (no content type) -->\n <p>This is a sample HTML 5 document.</p>\n
|
12
|
+
\ <section>\n\t <h1>Example of paragraphs</h1>\n\t This is the <em>first</em>
|
13
|
+
paragraph in this example.\n\t <p>This is the second.</p>\n\t <p>Test<br>test</p>\n
|
14
|
+
\ </body>\n</html>\n"
|
15
|
+
headers:
|
16
|
+
Content-Type:
|
17
|
+
- text/html; charset=utf-8
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
Accept:
|
21
|
+
- "*/*"
|
22
|
+
User-Agent:
|
23
|
+
- Ruby
|
24
|
+
response:
|
25
|
+
status:
|
26
|
+
code: 200
|
27
|
+
message: OK
|
28
|
+
headers:
|
29
|
+
Server:
|
30
|
+
- nginx/1.11.5
|
31
|
+
Date:
|
32
|
+
- Sat, 17 Dec 2016 21:22:38 GMT
|
33
|
+
Content-Type:
|
34
|
+
- application/json; charset=utf-8
|
35
|
+
Transfer-Encoding:
|
36
|
+
- chunked
|
37
|
+
Connection:
|
38
|
+
- keep-alive
|
39
|
+
Accept-Encoding:
|
40
|
+
- gzip
|
41
|
+
Access-Control-Allow-Origin:
|
42
|
+
- "*"
|
43
|
+
Access-Control-Allow-Headers:
|
44
|
+
- content-type
|
45
|
+
Expires:
|
46
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
47
|
+
Cache-Control:
|
48
|
+
- no-cache
|
49
|
+
Strict-Transport-Security:
|
50
|
+
- max-age=31536000; includeSubDomains; preload
|
51
|
+
body:
|
52
|
+
encoding: ASCII-8BIT
|
53
|
+
string: !binary |-
|
54
|
+
eyJtZXNzYWdlcyI6W3sidHlwZSI6ImVycm9yIiwibGFzdExpbmUiOjE1LCJs
|
55
|
+
YXN0Q29sdW1uIjo5LCJmaXJzdENvbHVtbiI6MywibWVzc2FnZSI6IkVuZCB0
|
56
|
+
YWcgZm9yICDigJxib2R54oCdIHNlZW4sIGJ1dCB0aGVyZSB3ZXJlIHVuY2xv
|
57
|
+
c2VkIGVsZW1lbnRzLiIsImV4dHJhY3QiOiJlc3Q8L3A+XG4gIDwvYm9keT5c
|
58
|
+
bjwvaHRtIiwiaGlsaXRlU3RhcnQiOjEwLCJoaWxpdGVMZW5ndGgiOjd9LHsi
|
59
|
+
dHlwZSI6ImVycm9yIiwibGFzdExpbmUiOjEwLCJsYXN0Q29sdW1uIjoxMywi
|
60
|
+
Zmlyc3RDb2x1bW4iOjUsIm1lc3NhZ2UiOiJVbmNsb3NlZCBlbGVtZW50IOKA
|
61
|
+
nHNlY3Rpb27igJ0uIiwiZXh0cmFjdCI6Ii48L3A+XG4gICAgPHNlY3Rpb24+
|
62
|
+
XG5cdCAgPGgiLCJoaWxpdGVTdGFydCI6MTAsImhpbGl0ZUxlbmd0aCI6OX1d
|
63
|
+
LCJzb3VyY2UiOnsidHlwZSI6InRleHQvaHRtbCIsImVuY29kaW5nIjoiVVRG
|
64
|
+
LTgiLCJjb2RlIjoiPCFET0NUWVBFIGh0bWw+XG48aHRtbCBsYW5nPVwiZW4t
|
65
|
+
Y2FcIj5cbiAgPGhlYWQ+XG4gICAgPCEtLTxtZXRhIGh0dHAtZXF1aXY9XCJD
|
66
|
+
b250ZW50LXR5cGVcIiBjb250ZW50PVwidGV4dC9odG1sOyBjaGFyc2V0PWlz
|
67
|
+
by04ODU5LTFcIj4tLT5cbiAgICA8dGl0bGU+SFRNTCA1IEV4YW1wbGU8L3Rp
|
68
|
+
dGxlPlxuICA8L2hlYWQ+XG4gIDxib2R5PlxuICBcdDwhLS0gc2hvdWxkIGhh
|
69
|
+
dmUgb25lIGVycm9yIChtaXNzaW5nIDwvc2VjdGlvbj4pIGFuZCBvbmUgd2Fy
|
70
|
+
bmluZyAobm8gY29udGVudCB0eXBlKSAtLT5cbiAgICA8cD5UaGlzIGlzIGEg
|
71
|
+
c2FtcGxlIEhUTUwgNSBkb2N1bWVudC48L3A+XG4gICAgPHNlY3Rpb24+XG5c
|
72
|
+
dCAgPGgxPkV4YW1wbGUgb2YgcGFyYWdyYXBoczwvaDE+XG5cdCAgVGhpcyBp
|
73
|
+
cyB0aGUgPGVtPmZpcnN0PC9lbT4gcGFyYWdyYXBoIGluIHRoaXMgZXhhbXBs
|
74
|
+
ZS5cblx0ICA8cD5UaGlzIGlzIHRoZSBzZWNvbmQuPC9wPlxuXHQgIDxwPlRl
|
75
|
+
c3Q8YnI+dGVzdDwvcD5cbiAgPC9ib2R5PlxuPC9odG1sPiJ9fQo=
|
76
|
+
http_version:
|
77
|
+
recorded_at: Sat, 17 Dec 2016 21:22:38 GMT
|
78
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,87 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://validator.nu/?out=json&parser=html&showsource=yes
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |2
|
9
|
+
<!DOCTYPE html>
|
10
|
+
<html lang="en-ca">
|
11
|
+
<head>
|
12
|
+
<title>HTML 5 Example</title>
|
13
|
+
</head>
|
14
|
+
<body>
|
15
|
+
<!-- should have one error (missing </section>) -->
|
16
|
+
<p>This is a sample HTML 5 document.</p>
|
17
|
+
<section>
|
18
|
+
<h1>Example of paragraphs</h1>
|
19
|
+
This is the <em>first</em> paragraph in this example.
|
20
|
+
<p>This is the second.</p>
|
21
|
+
<p>Test<br>test</p>
|
22
|
+
</body>
|
23
|
+
</html>
|
24
|
+
headers:
|
25
|
+
Content-Type:
|
26
|
+
- text/html; charset=utf-8
|
27
|
+
Accept-Encoding:
|
28
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
29
|
+
Accept:
|
30
|
+
- "*/*"
|
31
|
+
User-Agent:
|
32
|
+
- Ruby
|
33
|
+
response:
|
34
|
+
status:
|
35
|
+
code: 200
|
36
|
+
message: OK
|
37
|
+
headers:
|
38
|
+
Server:
|
39
|
+
- nginx/1.11.5
|
40
|
+
Date:
|
41
|
+
- Sat, 17 Dec 2016 21:22:39 GMT
|
42
|
+
Content-Type:
|
43
|
+
- application/json; charset=utf-8
|
44
|
+
Transfer-Encoding:
|
45
|
+
- chunked
|
46
|
+
Connection:
|
47
|
+
- keep-alive
|
48
|
+
Accept-Encoding:
|
49
|
+
- gzip
|
50
|
+
Access-Control-Allow-Origin:
|
51
|
+
- "*"
|
52
|
+
Access-Control-Allow-Headers:
|
53
|
+
- content-type
|
54
|
+
Expires:
|
55
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
56
|
+
Cache-Control:
|
57
|
+
- no-cache
|
58
|
+
Strict-Transport-Security:
|
59
|
+
- max-age=31536000; includeSubDomains; preload
|
60
|
+
body:
|
61
|
+
encoding: ASCII-8BIT
|
62
|
+
string: !binary |-
|
63
|
+
eyJtZXNzYWdlcyI6W3sidHlwZSI6ImVycm9yIiwibGFzdExpbmUiOjE0LCJs
|
64
|
+
YXN0Q29sdW1uIjoxNSwiZmlyc3RDb2x1bW4iOjksIm1lc3NhZ2UiOiJFbmQg
|
65
|
+
dGFnIGZvciAg4oCcYm9keeKAnSBzZWVuLCBidXQgdGhlcmUgd2VyZSB1bmNs
|
66
|
+
b3NlZCBlbGVtZW50cy4iLCJleHRyYWN0IjoiPlxuICAgICAgICA8L2JvZHk+
|
67
|
+
XG4gICAgICIsImhpbGl0ZVN0YXJ0IjoxMCwiaGlsaXRlTGVuZ3RoIjo3fSx7
|
68
|
+
InR5cGUiOiJlcnJvciIsImxhc3RMaW5lIjo5LCJsYXN0Q29sdW1uIjoxOSwi
|
69
|
+
Zmlyc3RDb2x1bW4iOjExLCJtZXNzYWdlIjoiVW5jbG9zZWQgZWxlbWVudCDi
|
70
|
+
gJxzZWN0aW9u4oCdLiIsImV4dHJhY3QiOiIgICAgICAgICAgPHNlY3Rpb24+
|
71
|
+
XG4gICAgICIsImhpbGl0ZVN0YXJ0IjoxMCwiaGlsaXRlTGVuZ3RoIjo5fV0s
|
72
|
+
InNvdXJjZSI6eyJ0eXBlIjoidGV4dC9odG1sIiwiZW5jb2RpbmciOiJVVEYt
|
73
|
+
OCIsImNvZGUiOiIgICAgICA8IURPQ1RZUEUgaHRtbD5cbiAgICAgIDxodG1s
|
74
|
+
IGxhbmc9XCJlbi1jYVwiPlxuICAgICAgICA8aGVhZD5cbiAgICAgICAgICA8
|
75
|
+
dGl0bGU+SFRNTCA1IEV4YW1wbGU8L3RpdGxlPlxuICAgICAgICA8L2hlYWQ+
|
76
|
+
XG4gICAgICAgIDxib2R5PlxuICAgICAgICAgIDwhLS0gc2hvdWxkIGhhdmUg
|
77
|
+
b25lIGVycm9yIChtaXNzaW5nIDwvc2VjdGlvbj4pIC0tPlxuICAgICAgICAg
|
78
|
+
IDxwPlRoaXMgaXMgYSBzYW1wbGUgSFRNTCA1IGRvY3VtZW50LjwvcD5cbiAg
|
79
|
+
ICAgICAgICA8c2VjdGlvbj5cbiAgICAgICAgICA8aDE+RXhhbXBsZSBvZiBw
|
80
|
+
YXJhZ3JhcGhzPC9oMT5cbiAgICAgICAgICBUaGlzIGlzIHRoZSA8ZW0+Zmly
|
81
|
+
c3Q8L2VtPiBwYXJhZ3JhcGggaW4gdGhpcyBleGFtcGxlLlxuICAgICAgICAg
|
82
|
+
IDxwPlRoaXMgaXMgdGhlIHNlY29uZC48L3A+XG4gICAgICAgICAgPHA+VGVz
|
83
|
+
dDxicj50ZXN0PC9wPlxuICAgICAgICA8L2JvZHk+XG4gICAgICA8L2h0bWw+
|
84
|
+
In19Cg==
|
85
|
+
http_version:
|
86
|
+
recorded_at: Sat, 17 Dec 2016 21:22:39 GMT
|
87
|
+
recorded_with: VCR 3.0.3
|