1. Liam Staskawicz
  2. fanlet

Commits

Liam Staskawicz  committed 49de0b1

* updates for fantom 1.0.56
* construct reasonable Uri in servletreq
** thanks to chunquedong

  • Participants
  • Parent commits f70ce49
  • Branches default

Comments (0)

Files changed (2)

File fan/ServletReq.fan

View file
     webIn = Interop.toFan(req.getInputStream)
   }
   
-  override InStream in() { return webIn }
-  override IpAddr remoteAddr() { return IpAddr(req.getRemoteAddr) }
-  override Int remotePort() { return req.getRemotePort }
+  override InStream in() { webIn }
+  override IpAddr remoteAddr() { IpAddr(req.getRemoteAddr) }
+  override Int remotePort() { req.getRemotePort }
   override Version version := Version("0")
-  override Str method() { return req.getMethod }
-  override Uri uri() { return Uri.fromStr(req.getRequestURI) }
-  override once WebSession session() { return ServletSession(req.getSession) }
+  override Str method() { req.getMethod }
+  override once WebSession session() { ServletSession(req.getSession) }
+  override SocketOptions socketOptions() { throw UnsupportedErr() }
+  override Uri uri()
+  {
+    if (req.getQueryString == null)
+      return Uri.fromStr(req.getRequestURI)
+    else
+      return Uri.fromStr(req.getRequestURI + "?" + req.getQueryString)
+  }
   
   override once Str:Str headers()
   {
-    hdrs := Str:Str[:]
+    hdrs := Str:Str[:] { caseInsensitive = true }
     e := req.getHeaderNames
     while (e.hasMoreElements)
     {

File fan/ServletSession.fan

View file
 {
   private HttpSession? session
   private Bool isValid := true
+  override Str:Obj? map := Str:Obj[:]
+  override const Str id
   
-  new make(HttpSession? hs) : super(hs.getId)
+  new make(HttpSession? hs)
   {
     session = hs
+    id = session.getId
     e := session.getAttributeNames
     while (e.hasMoreElements)
     {
   
   override Void delete()
   {
-    session.invalidate()
+    session.invalidate
     isValid = false
   }