Skip to content

Commit

Permalink
let appengine set content type if from blobstore
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Hamblen committed Aug 8, 2010
1 parent 77d8a5c commit 847d9ae
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/main/scala/Sourced.scala
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,11 @@ class Sourced extends Responses with Urls with Requests with Auth with IO with u
} orElse { _ => InternalServerError }

case GET(Path(Seg(org :: project :: version :: srcName :: _), req)) =>
DocStore(url(req)) match {
case Some(src) =>
Ok ~> ContentType(src.contentType) ~> (src.doc match{
case null => BlobResponder(src.blobKey, blobs)
case _ => ResponseBytes(src.doc.getBytes)
})
case _ => NotFound
}
DocStore(url(req)) map { src =>
Option(src.doc) map { doc =>
Ok ~> ContentType(src.contentType) ~> ResponseBytes(doc.getBytes)
} getOrElse BlobResponder(src.blobKey, blobs)
} getOrElse NotFound

case GET(Path(Seg("admin" :: Nil), req)) => adminPage(req) {
<form action="setkey" method="post">
Expand Down

0 comments on commit 847d9ae

Please sign in to comment.