Added support for URIs (#2708)
This commit is contained in:
parent
b37987d3b7
commit
bbc77d19e1
File diff suppressed because one or more lines are too long
|
@ -501,7 +501,8 @@
|
|||
"css",
|
||||
"javascript",
|
||||
"json",
|
||||
"markup"
|
||||
"markup",
|
||||
"uri"
|
||||
],
|
||||
"owner": "danielgtaylor"
|
||||
},
|
||||
|
@ -1210,6 +1211,14 @@
|
|||
"alias": ["uscript", "uc"],
|
||||
"owner": "RunDevelopment"
|
||||
},
|
||||
"uri": {
|
||||
"title": "URI",
|
||||
"alias": "url",
|
||||
"aliasTitles": {
|
||||
"url": "URL"
|
||||
},
|
||||
"owner": "RunDevelopment"
|
||||
},
|
||||
"v": {
|
||||
"title": "V",
|
||||
"require": "clike",
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
'request-target': {
|
||||
pattern: /^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,
|
||||
lookbehind: true,
|
||||
alias: 'url'
|
||||
alias: 'url',
|
||||
inside: Prism.languages.uri
|
||||
},
|
||||
// HTTP Version
|
||||
'http-version': {
|
||||
|
|
|
@ -1 +1 @@
|
|||
!function(t){t.languages.http={"request-line":{pattern:/^(?:GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\s(?:https?:\/\/|\/)\S*\sHTTP\/[0-9.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url"},"http-version":{pattern:/^(\s)HTTP\/[0-9.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[0-9.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[0-9.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},"header-name":{pattern:/^[\w-]+:(?=.)/m,alias:"keyword"}};var a,e,s,n=t.languages,r={"application/javascript":n.javascript,"application/json":n.json||n.javascript,"application/xml":n.xml,"text/xml":n.xml,"text/html":n.html,"text/css":n.css},i={"application/json":!0,"application/xml":!0};for(var p in r)if(r[p]){a=a||{};var o=i[p]?(void 0,s=(e=p).replace(/^[a-z]+\//,""),"(?:"+e+"|\\w+/(?:[\\w.-]+\\+)+"+s+"(?![+\\w.-]))"):p;a[p.replace(/\//g,"-")]={pattern:RegExp("(content-type:\\s*"+o+".*)(?:\\r?\\n|\\r){2}[\\s\\S]*","i"),lookbehind:!0,inside:r[p]}}a&&t.languages.insertBefore("http","header-name",a)}(Prism);
|
||||
!function(t){t.languages.http={"request-line":{pattern:/^(?:GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\s(?:https?:\/\/|\/)\S*\sHTTP\/[0-9.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:t.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[0-9.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[0-9.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[0-9.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},"header-name":{pattern:/^[\w-]+:(?=.)/m,alias:"keyword"}};var a,e,s,n=t.languages,i={"application/javascript":n.javascript,"application/json":n.json||n.javascript,"application/xml":n.xml,"text/xml":n.xml,"text/html":n.html,"text/css":n.css},r={"application/json":!0,"application/xml":!0};for(var p in i)if(i[p]){a=a||{};var o=r[p]?(void 0,s=(e=p).replace(/^[a-z]+\//,""),"(?:"+e+"|\\w+/(?:[\\w.-]+\\+)+"+s+"(?![+\\w.-]))"):p;a[p.replace(/\//g,"-")]={pattern:RegExp("(content-type:\\s*"+o+".*)(?:\\r?\\n|\\r){2}[\\s\\S]*","i"),lookbehind:!0,inside:i[p]}}a&&t.languages.insertBefore("http","header-name",a)}(Prism);
|
|
@ -0,0 +1,96 @@
|
|||
// https://tools.ietf.org/html/rfc3986#appendix-A
|
||||
|
||||
Prism.languages.uri = {
|
||||
'scheme': {
|
||||
pattern: /^[a-z][a-z0-9+.-]*:/im,
|
||||
greedy: true,
|
||||
inside: {
|
||||
'scheme-delimiter': /:$/
|
||||
}
|
||||
},
|
||||
'fragment': {
|
||||
pattern: /#[\w\-.~!$&'()*+,;=%:@/?]*/,
|
||||
inside: {
|
||||
'fragment-delimiter': /^#/
|
||||
}
|
||||
},
|
||||
'query': {
|
||||
pattern: /\?[\w\-.~!$&'()*+,;=%:@/?]*/,
|
||||
inside: {
|
||||
'query-delimiter': {
|
||||
pattern: /^\?/,
|
||||
greedy: true
|
||||
},
|
||||
'pair-delimiter': /[&;]/,
|
||||
'pair': {
|
||||
pattern: /^[^=][\s\S]*/,
|
||||
inside: {
|
||||
'key': /^[^=]+/,
|
||||
'value': {
|
||||
pattern: /(^=)[\s\S]+/,
|
||||
lookbehind: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'authority': {
|
||||
pattern: RegExp(
|
||||
/^\/\//.source
|
||||
// [ userinfo "@" ]
|
||||
+ /(?:[\w\-.~!$&'()*+,;=%:]*@)?/.source
|
||||
// host
|
||||
+ (
|
||||
'(?:'
|
||||
// IP-literal
|
||||
+ /\[(?:[0-9a-fA-F:.]{2,48}|v[0-9a-fA-F]+\.[\w\-.~!$&'()*+,;=]+)\]/.source
|
||||
+ '|'
|
||||
// IPv4address or registered name
|
||||
+ /[\w\-.~!$&'()*+,;=%]*/.source
|
||||
+ ')'
|
||||
)
|
||||
// [ ":" port ]
|
||||
+ /(?::\d*)?/.source,
|
||||
'm'
|
||||
),
|
||||
inside: {
|
||||
'authority-delimiter': /^\/\//,
|
||||
'user-info-segment': {
|
||||
pattern: /^[\w\-.~!$&'()*+,;=%:]*@/,
|
||||
inside: {
|
||||
'user-info-delimiter': /@$/,
|
||||
'user-info': /^[\w\-.~!$&'()*+,;=%:]+/
|
||||
}
|
||||
},
|
||||
'port-segment': {
|
||||
pattern: /:\d*$/,
|
||||
inside: {
|
||||
'port-delimiter': /^:/,
|
||||
'port': /^\d+/
|
||||
}
|
||||
},
|
||||
'host': {
|
||||
pattern: /[\s\S]+/,
|
||||
inside: {
|
||||
'ip-literal': {
|
||||
pattern: /^\[[\s\S]+\]$/,
|
||||
inside: {
|
||||
'ip-literal-delimiter': /^\[|\]$/,
|
||||
'ipv-future': /^v[\s\S]+/,
|
||||
'ipv6-address': /^[\s\S]+/
|
||||
}
|
||||
},
|
||||
'ipv4-address': /^(?:(?:[03-9]\d?|[12]\d{0,2})\.){3}(?:[03-9]\d?|[12]{0,2})$/
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'path': {
|
||||
pattern: /^[\w\-.~!$&'()*+,;=%:@/]+/m,
|
||||
inside: {
|
||||
'path-separator': /\//
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Prism.languages.url = Prism.languages.uri;
|
|
@ -0,0 +1 @@
|
|||
Prism.languages.uri={scheme:{pattern:/^[a-z][a-z0-9+.-]*:/im,greedy:!0,inside:{"scheme-delimiter":/:$/}},fragment:{pattern:/#[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"fragment-delimiter":/^#/}},query:{pattern:/\?[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"query-delimiter":{pattern:/^\?/,greedy:!0},"pair-delimiter":/[&;]/,pair:{pattern:/^[^=][\s\S]*/,inside:{key:/^[^=]+/,value:{pattern:/(^=)[\s\S]+/,lookbehind:!0}}}}},authority:{pattern:RegExp("^//(?:[\\w\\-.~!$&'()*+,;=%:]*@)?(?:\\[(?:[0-9a-fA-F:.]{2,48}|v[0-9a-fA-F]+\\.[\\w\\-.~!$&'()*+,;=]+)\\]|[\\w\\-.~!$&'()*+,;=%]*)(?::\\d*)?","m"),inside:{"authority-delimiter":/^\/\//,"user-info-segment":{pattern:/^[\w\-.~!$&'()*+,;=%:]*@/,inside:{"user-info-delimiter":/@$/,"user-info":/^[\w\-.~!$&'()*+,;=%:]+/}},"port-segment":{pattern:/:\d*$/,inside:{"port-delimiter":/^:/,port:/^\d+/}},host:{pattern:/[\s\S]+/,inside:{"ip-literal":{pattern:/^\[[\s\S]+\]$/,inside:{"ip-literal-delimiter":/^\[|\]$/,"ipv-future":/^v[\s\S]+/,"ipv6-address":/^[\s\S]+/}},"ipv4-address":/^(?:(?:[03-9]\d?|[12]\d{0,2})\.){3}(?:[03-9]\d?|[12]{0,2})$/}}}},path:{pattern:/^[\w\-.~!$&'()*+,;=%:@/]+/m,inside:{"path-separator":/\//}}},Prism.languages.url=Prism.languages.uri;
|
|
@ -0,0 +1,13 @@
|
|||
<h2>Full example</h2>
|
||||
<pre><code>https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top
|
||||
https://example.com/path/resource.txt#fragment
|
||||
ldap://[2001:db8::7]/c=GB?objectClass?one
|
||||
mailto:John.Doe@example.com
|
||||
news:comp.infosystems.www.servers.unix
|
||||
tel:+1-816-555-1212
|
||||
telnet://192.0.2.16:80/
|
||||
urn:oasis:names:specification:docbook:dtd:xml:4.1.2
|
||||
//example.com/path/resource.txt
|
||||
/path/resource.txt
|
||||
path/resource.txt
|
||||
</code></pre>
|
|
@ -224,6 +224,7 @@
|
|||
"tsconfig": "typoscript",
|
||||
"uscript": "unrealscript",
|
||||
"uc": "unrealscript",
|
||||
"url": "uri",
|
||||
"vb": "visual-basic",
|
||||
"vba": "visual-basic",
|
||||
"xeoracube": "xeora",
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -199,6 +199,8 @@
|
|||
"tsconfig": "TSConfig",
|
||||
"uscript": "UnrealScript",
|
||||
"uc": "UnrealScript",
|
||||
"uri": "URI",
|
||||
"url": "URL",
|
||||
"vbnet": "VB.Net",
|
||||
"vhdl": "VHDL",
|
||||
"vim": "vim",
|
||||
|
|
|
@ -1 +1 @@
|
|||
!function(){if("undefined"!=typeof self&&self.Prism&&self.document)if(Prism.plugins.toolbar){var r={none:"Plain text",html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",rss:"RSS",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"ABNF",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aspnet:"ASP.NET (C#)",asm6502:"6502 Assembly",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",bbcode:"BBcode",bnf:"BNF",rbnf:"RBNF",bsl:"BSL (1C:Enterprise)",oscript:"OneScript",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cil:"CIL",cmake:"CMake",coffee:"CoffeeScript",conc:"Concurnas",csp:"Content-Security-Policy","css-extras":"CSS Extras",dataweave:"DataWeave",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",dot:"DOT (Graphviz)",gv:"DOT (Graphviz)",ebnf:"EBNF",editorconfig:"EditorConfig",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",graphql:"GraphQL",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",ignore:".ignore",gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras",json:"JSON",webmanifest:"Web App Manifest",json5:"JSON5",jsonp:"JSONP",jsstacktrace:"JS stack trace","js-templates":"JS Templates",kts:"Kotlin Script",kt:"Kotlin",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",lolcode:"LOLCODE",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",mongodb:"MongoDB",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",naniscript:"Naninovel Script",nani:"Naninovel Script",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",objectpascal:"Object Pascal",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",promql:"PromQL",properties:".properties",protobuf:"Protocol Buffers",purebasic:"PureBasic",pbfasm:"PureBasic",purs:"PureScript",py:"Python",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rpy:"Ren'py",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)","shell-session":"Shell session","sh-session":"Shell session",shellsession:"Shell session",sml:"SML",smlnj:"SML/NJ",solidity:"Solidity (Ethereum)",sol:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",iecst:"Structured Text (IEC 61131-3)","t4-templating":"T4 templating","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)",tap:"TAP",tt2:"Template Toolkit 2",toml:"TOML",trig:"TriG",ts:"TypeScript",tsconfig:"TSConfig",uscript:"UnrealScript",uc:"UnrealScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xeoracube:"XeoraCube","xml-doc":"XML doc (.net)",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML",yang:"YANG"};Prism.plugins.toolbar.registerButton("show-language",function(e){var a=e.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var t,s=a.getAttribute("data-language")||r[e.language]||((t=e.language)?(t.substring(0,1).toUpperCase()+t.substring(1)).replace(/s(?=cript)/,"S"):t);if(s){var o=document.createElement("span");return o.textContent=s,o}}})}else console.warn("Show Languages plugin loaded before Toolbar plugin.")}();
|
||||
!function(){if("undefined"!=typeof self&&self.Prism&&self.document)if(Prism.plugins.toolbar){var r={none:"Plain text",html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",rss:"RSS",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"ABNF",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aspnet:"ASP.NET (C#)",asm6502:"6502 Assembly",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",bbcode:"BBcode",bnf:"BNF",rbnf:"RBNF",bsl:"BSL (1C:Enterprise)",oscript:"OneScript",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cil:"CIL",cmake:"CMake",coffee:"CoffeeScript",conc:"Concurnas",csp:"Content-Security-Policy","css-extras":"CSS Extras",dataweave:"DataWeave",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",dot:"DOT (Graphviz)",gv:"DOT (Graphviz)",ebnf:"EBNF",editorconfig:"EditorConfig",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",graphql:"GraphQL",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",ignore:".ignore",gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras",json:"JSON",webmanifest:"Web App Manifest",json5:"JSON5",jsonp:"JSONP",jsstacktrace:"JS stack trace","js-templates":"JS Templates",kts:"Kotlin Script",kt:"Kotlin",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",lolcode:"LOLCODE",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",mongodb:"MongoDB",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",naniscript:"Naninovel Script",nani:"Naninovel Script",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",objectpascal:"Object Pascal",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",promql:"PromQL",properties:".properties",protobuf:"Protocol Buffers",purebasic:"PureBasic",pbfasm:"PureBasic",purs:"PureScript",py:"Python",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rpy:"Ren'py",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)","shell-session":"Shell session","sh-session":"Shell session",shellsession:"Shell session",sml:"SML",smlnj:"SML/NJ",solidity:"Solidity (Ethereum)",sol:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",iecst:"Structured Text (IEC 61131-3)","t4-templating":"T4 templating","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)",tap:"TAP",tt2:"Template Toolkit 2",toml:"TOML",trig:"TriG",ts:"TypeScript",tsconfig:"TSConfig",uscript:"UnrealScript",uc:"UnrealScript",uri:"URI",url:"URL",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xeoracube:"XeoraCube","xml-doc":"XML doc (.net)",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML",yang:"YANG"};Prism.plugins.toolbar.registerButton("show-language",function(e){var a=e.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var t,s=a.getAttribute("data-language")||r[e.language]||((t=e.language)?(t.substring(0,1).toUpperCase()+t.substring(1)).replace(/s(?=cript)/,"S"):t);if(s){var o=document.createElement("span");return o.textContent=s,o}}})}else console.warn("Show Languages plugin loaded before Toolbar plugin.")}();
|
|
@ -0,0 +1,162 @@
|
|||
POST http://example.com HTTP/1.0
|
||||
GET http://localhost:9999/foo.html HTTP/1.1
|
||||
PUT http://www.example.com HTTP/2.0
|
||||
DELETE https://example.com HTTP/1.1
|
||||
OPTIONS https://www.example.com HTTP/1.1
|
||||
PATCH http://example.com HTTP/1.0
|
||||
TRACE http://example.com HTTP/1.0
|
||||
CONNECT http://example.com HTTP/1.0
|
||||
GET /path/to/foo.html HTTP/1.1
|
||||
GET / HTTP/1.1
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["request-line", [
|
||||
["method", "POST"],
|
||||
["request-target", [
|
||||
["scheme", [
|
||||
"http",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["example.com"]]
|
||||
]]
|
||||
]],
|
||||
["http-version", "HTTP/1.0"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", [
|
||||
["scheme", [
|
||||
"http",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["localhost"]],
|
||||
["port-segment", [
|
||||
["port-delimiter", ":"],
|
||||
["port", "9999"]
|
||||
]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"foo.html"
|
||||
]]
|
||||
]],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "PUT"],
|
||||
["request-target", [
|
||||
["scheme", [
|
||||
"http",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["www.example.com"]]
|
||||
]]
|
||||
]],
|
||||
["http-version", "HTTP/2.0"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "DELETE"],
|
||||
["request-target", [
|
||||
["scheme", [
|
||||
"https",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["example.com"]]
|
||||
]]
|
||||
]],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "OPTIONS"],
|
||||
["request-target", [
|
||||
["scheme", [
|
||||
"https",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["www.example.com"]]
|
||||
]]
|
||||
]],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "PATCH"],
|
||||
["request-target", [
|
||||
["scheme", [
|
||||
"http",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["example.com"]]
|
||||
]]
|
||||
]],
|
||||
["http-version", "HTTP/1.0"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "TRACE"],
|
||||
["request-target", [
|
||||
["scheme", [
|
||||
"http",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["example.com"]]
|
||||
]]
|
||||
]],
|
||||
["http-version", "HTTP/1.0"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "CONNECT"],
|
||||
["request-target", [
|
||||
["scheme", [
|
||||
"http",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["example.com"]]
|
||||
]]
|
||||
]],
|
||||
["http-version", "HTTP/1.0"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", [
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"path",
|
||||
["path-separator", "/"],
|
||||
"to",
|
||||
["path-separator", "/"],
|
||||
"foo.html"
|
||||
]]
|
||||
]],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", [
|
||||
["path", [
|
||||
["path-separator", "/"]
|
||||
]]
|
||||
]],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for request lines.
|
|
@ -1,124 +1,64 @@
|
|||
GET / HTTP/1.0
|
||||
POST http://example.com HTTP/1.0
|
||||
GET http://localhost:9999/foo.html HTTP/1.1
|
||||
PUT http://www.example.com HTTP/2.0
|
||||
DELETE https://example.com HTTP/1.1
|
||||
OPTIONS https://www.example.com HTTP/1.1
|
||||
PATCH http://example.com HTTP/1.0
|
||||
TRACE http://example.com HTTP/1.0
|
||||
CONNECT http://example.com HTTP/1.0
|
||||
GET /path/to/foo.html HTTP/1.1
|
||||
GET / HTTP/1.1
|
||||
GET /path/to/file HTTP/1.1
|
||||
GET /path/to/file?a=1&b=2 HTTP/1.1
|
||||
GET http://example.com HTTP/1.1
|
||||
GET https://example.com HTTP/1.1
|
||||
GET https://example.com/ HTTP/1.1
|
||||
GET https://example.com/path/to/file?a=1&b=2 HTTP/1.1
|
||||
GET https://example.com:443/path/to/file?a=1&b=2 HTTP/1.1
|
||||
GET https://user:pass@example.com:443/path/to/file?a=1&b=2 HTTP/1.1
|
||||
HEAD / HTTP/1.1
|
||||
POST / HTTP/1.1
|
||||
PUT / HTTP/1.1
|
||||
DELETE / HTTP/1.1
|
||||
CONNECT / HTTP/1.1
|
||||
OPTIONS / HTTP/1.1
|
||||
TRACE / HTTP/1.1
|
||||
PATCH / HTTP/1.1
|
||||
PRI / HTTP/1.1
|
||||
SEARCH / HTTP/1.1
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", "/"],
|
||||
["method", "POST"],
|
||||
["request-target", "http://example.com"],
|
||||
["http-version", "HTTP/1.0"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", "/"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", "/path/to/file"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", "/path/to/file?a=1&b=2"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", "http://example.com"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", "https://example.com"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", "https://example.com/"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", "https://example.com/path/to/file?a=1&b=2"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", "https://example.com:443/path/to/file?a=1&b=2"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", "https://user:pass@example.com:443/path/to/file?a=1&b=2"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "HEAD"],
|
||||
["request-target", "/"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "POST"],
|
||||
["request-target", "/"],
|
||||
["request-target", "http://localhost:9999/foo.html"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "PUT"],
|
||||
["request-target", "/"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
["request-target", "http://www.example.com"],
|
||||
["http-version", "HTTP/2.0"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "DELETE"],
|
||||
["request-target", "/"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "CONNECT"],
|
||||
["request-target", "/"],
|
||||
["request-target", "https://example.com"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "OPTIONS"],
|
||||
["request-target", "/"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "TRACE"],
|
||||
["request-target", "/"],
|
||||
["request-target", "https://www.example.com"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "PATCH"],
|
||||
["request-target", "/"],
|
||||
["request-target", "http://example.com"],
|
||||
["http-version", "HTTP/1.0"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "TRACE"],
|
||||
["request-target", "http://example.com"],
|
||||
["http-version", "HTTP/1.0"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "CONNECT"],
|
||||
["request-target", "http://example.com"],
|
||||
["http-version", "HTTP/1.0"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "GET"],
|
||||
["request-target", "/path/to/foo.html"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "PRI"],
|
||||
["request-target", "/"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]],
|
||||
["request-line", [
|
||||
["method", "SEARCH"],
|
||||
["method", "GET"],
|
||||
["request-target", "/"],
|
||||
["http-version", "HTTP/1.1"]
|
||||
]]
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
https://john.doe@www.example.com:123/forum/questions
|
||||
ftp://ftp.is.co.za/rfc/rfc1808.txt
|
||||
ldap://[2001:db8::7]/
|
||||
//192.0.2.16:80/
|
||||
//example.com/path/resource.txt
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["scheme", [
|
||||
"https",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["user-info-segment", [
|
||||
["user-info", "john.doe"],
|
||||
["user-info-delimiter", "@"]
|
||||
]],
|
||||
["host", ["www.example.com"]],
|
||||
["port-segment", [
|
||||
["port-delimiter", ":"],
|
||||
["port", "123"]
|
||||
]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"forum",
|
||||
["path-separator", "/"],
|
||||
"questions"
|
||||
]],
|
||||
|
||||
["scheme", [
|
||||
"ftp",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["ftp.is.co.za"]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"rfc",
|
||||
["path-separator", "/"],
|
||||
"rfc1808.txt"
|
||||
]],
|
||||
|
||||
["scheme", [
|
||||
"ldap",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", [
|
||||
["ip-literal", [
|
||||
["ip-literal-delimiter", "["],
|
||||
["ipv6-address", "2001:db8::7"],
|
||||
["ip-literal-delimiter", "]"]
|
||||
]]
|
||||
]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"]
|
||||
]],
|
||||
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["192.0.2.16"]],
|
||||
["port-segment", [
|
||||
["port-delimiter", ":"],
|
||||
["port", "80"]
|
||||
]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"]
|
||||
]],
|
||||
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["example.com"]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"path",
|
||||
["path-separator", "/"],
|
||||
"resource.txt"
|
||||
]]
|
||||
]
|
|
@ -0,0 +1,124 @@
|
|||
https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top
|
||||
ldap://[2001:db8::7]/c=GB?objectClass?one
|
||||
mailto:John.Doe@example.com
|
||||
news:comp.infosystems.www.servers.unix
|
||||
telnet://192.0.2.16:80/
|
||||
https://example.com/path/resource.txt#fragment
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["scheme", [
|
||||
"https",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["user-info-segment", [
|
||||
["user-info", "john.doe"],
|
||||
["user-info-delimiter", "@"]
|
||||
]],
|
||||
["host", ["www.example.com"]],
|
||||
["port-segment", [
|
||||
["port-delimiter", ":"],
|
||||
["port", "123"]
|
||||
]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"forum",
|
||||
["path-separator", "/"],
|
||||
"questions",
|
||||
["path-separator", "/"]
|
||||
]],
|
||||
["query", [
|
||||
["query-delimiter", "?"],
|
||||
["pair", [
|
||||
["key", "tag"],
|
||||
"=",
|
||||
["value", "networking"]
|
||||
]],
|
||||
["pair-delimiter", "&"],
|
||||
["pair", [
|
||||
["key", "order"],
|
||||
"=",
|
||||
["value", "newest"]
|
||||
]]
|
||||
]],
|
||||
["fragment", [
|
||||
["fragment-delimiter", "#"],
|
||||
"top"
|
||||
]],
|
||||
|
||||
["scheme", [
|
||||
"ldap",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", [
|
||||
["ip-literal", [
|
||||
["ip-literal-delimiter", "["],
|
||||
["ipv6-address", "2001:db8::7"],
|
||||
["ip-literal-delimiter", "]"]
|
||||
]]
|
||||
]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"c=GB"
|
||||
]],
|
||||
["query", [
|
||||
["query-delimiter", "?"],
|
||||
["pair", [
|
||||
["key", "objectClass?one"]
|
||||
]]
|
||||
]],
|
||||
|
||||
["scheme", [
|
||||
"mailto",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["path", ["John.Doe@example.com"]],
|
||||
|
||||
["scheme", [
|
||||
"news",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["path", ["comp.infosystems.www.servers.unix"]],
|
||||
|
||||
["scheme", [
|
||||
"telnet",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["192.0.2.16"]],
|
||||
["port-segment", [
|
||||
["port-delimiter", ":"],
|
||||
["port", "80"]
|
||||
]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"]
|
||||
]],
|
||||
|
||||
["scheme", [
|
||||
"https",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["example.com"]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"path",
|
||||
["path-separator", "/"],
|
||||
"resource.txt"
|
||||
]],
|
||||
["fragment", [
|
||||
["fragment-delimiter", "#"],
|
||||
"fragment"
|
||||
]]
|
||||
]
|
|
@ -0,0 +1,78 @@
|
|||
?tag=networking&order=newest#top
|
||||
?objectClass?one
|
||||
?title=Query_string&action=edit
|
||||
http://example.com/kb/index.php?cat=1;id=23
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["query", [
|
||||
["query-delimiter", "?"],
|
||||
["pair", [
|
||||
["key", "tag"],
|
||||
"=",
|
||||
["value", "networking"]
|
||||
]],
|
||||
["pair-delimiter", "&"],
|
||||
["pair", [
|
||||
["key", "order"],
|
||||
"=",
|
||||
["value", "newest"]
|
||||
]]
|
||||
]],
|
||||
["fragment", [
|
||||
["fragment-delimiter", "#"],
|
||||
"top"
|
||||
]],
|
||||
|
||||
["query", [
|
||||
["query-delimiter", "?"],
|
||||
["pair", [
|
||||
["key", "objectClass?one"]
|
||||
]]
|
||||
]],
|
||||
|
||||
["query", [
|
||||
["query-delimiter", "?"],
|
||||
["pair", [
|
||||
["key", "title"],
|
||||
"=",
|
||||
["value", "Query_string"]
|
||||
]],
|
||||
["pair-delimiter", "&"],
|
||||
["pair", [
|
||||
["key", "action"],
|
||||
"=",
|
||||
["value", "edit"]
|
||||
]]
|
||||
]],
|
||||
|
||||
["scheme", [
|
||||
"http",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["example.com"]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"kb",
|
||||
["path-separator", "/"],
|
||||
"index.php"
|
||||
]],
|
||||
["query", [
|
||||
["query-delimiter", "?"],
|
||||
["pair", [
|
||||
["key", "cat"],
|
||||
"=",
|
||||
["value", "1"]
|
||||
]],
|
||||
["pair-delimiter", ";"],
|
||||
["pair", [
|
||||
["key", "id"],
|
||||
"=",
|
||||
["value", "23"]
|
||||
]]
|
||||
]]
|
||||
]
|
|
@ -0,0 +1,54 @@
|
|||
//example.com/path/resource.txt
|
||||
/path/resource.txt
|
||||
path/resource.txt
|
||||
../resource.txt
|
||||
./resource.txt
|
||||
resource.txt
|
||||
#fragment
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["example.com"]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"path",
|
||||
["path-separator", "/"],
|
||||
"resource.txt"
|
||||
]],
|
||||
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"path",
|
||||
["path-separator", "/"],
|
||||
"resource.txt"
|
||||
]],
|
||||
|
||||
["path", [
|
||||
"path",
|
||||
["path-separator", "/"],
|
||||
"resource.txt"
|
||||
]],
|
||||
|
||||
["path", [
|
||||
"..",
|
||||
["path-separator", "/"],
|
||||
"resource.txt"
|
||||
]],
|
||||
|
||||
["path", [
|
||||
".",
|
||||
["path-separator", "/"],
|
||||
"resource.txt"
|
||||
]],
|
||||
|
||||
["path", ["resource.txt"]],
|
||||
|
||||
["fragment", [
|
||||
["fragment-delimiter", "#"],
|
||||
"fragment"
|
||||
]]
|
||||
]
|
|
@ -0,0 +1,45 @@
|
|||
ftp://ftp.is.co.za/rfc/rfc1808.txt
|
||||
tel:+1-816-555-1212
|
||||
urn:oasis:names:specification:docbook:dtd:xml:4.1.2
|
||||
data:text/vnd-example+xyz;foo=bar;base64,R0lGODdh
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["scheme", [
|
||||
"ftp",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["authority", [
|
||||
["authority-delimiter", "//"],
|
||||
["host", ["ftp.is.co.za"]]
|
||||
]],
|
||||
["path", [
|
||||
["path-separator", "/"],
|
||||
"rfc",
|
||||
["path-separator", "/"],
|
||||
"rfc1808.txt"
|
||||
]],
|
||||
|
||||
["scheme", [
|
||||
"tel",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["path", ["+1-816-555-1212"]],
|
||||
|
||||
["scheme", [
|
||||
"urn",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["path", ["oasis:names:specification:docbook:dtd:xml:4.1.2"]],
|
||||
|
||||
["scheme", [
|
||||
"data",
|
||||
["scheme-delimiter", ":"]
|
||||
]],
|
||||
["path", [
|
||||
"text",
|
||||
["path-separator", "/"],
|
||||
"vnd-example+xyz;foo=bar;base64,R0lGODdh"
|
||||
]]
|
||||
]
|
Loading…
Reference in New Issue