Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Request-URI

  • Loading branch information...
commit 674c944dcc1c725a8cf7a9b7630885fd6fbd4864 1 parent f3dabff
Takeshi Abe authored
2  Makefile
View
@@ -147,6 +147,8 @@ test:
$(YPSILON) test/http/range-unit.scm
$(MOSH) test/http/request-header-field.scm
$(YPSILON) test/http/request-header-field.scm
+ $(MOSH) test/http/request-uri.scm
+ $(YPSILON) test/http/request-uri.scm
$(MOSH) test/http/stream.scm
$(YPSILON) test/http/stream.scm
$(MOSH) test/http/transfer-coding.scm
14 sitelib/http/request-uri.scm
View
@@ -0,0 +1,14 @@
+(library (http request-uri)
+ (export Request-URI)
+ (import (rnrs (6))
+ (http abnf)
+ (only (http uri) absoluteURI)
+ (only (http uri authority) authority)
+ (only (http uri path) abs_path))
+
+ ;;; 5.1.2 Request-URI
+
+ ;; Request-URI = "*" | absoluteURI | abs_path | authority
+ (define Request-URI (bar (char->rule #\*) absoluteURI abs_path authority))
+
+)
1  sitelib/http/uri/path.scm
View
@@ -2,6 +2,7 @@
(export path
path-abempty
path-absolute
+ (rename (path-absolute abs_path))
path-noscheme
path-rootless
path-empty)
17 test/http/request-uri.scm
View
@@ -0,0 +1,17 @@
+#!r6rs
+
+(import (rnrs (6))
+ (http request-uri)
+ (http assertion)
+ (xunit))
+
+(assert-parsing-successfully Request-URI
+ "/"
+ '(#\/ ())
+ )
+(assert-parsing-successfully Request-URI
+ "/foo/bar.html"
+ '(#\/ (((#\f #\o #\o) ((#\/ (#\b #\a #\r #\. #\h #\t #\m #\l))))))
+ )
+
+(report)
Please sign in to comment.
Something went wrong with that request. Please try again.