summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-07-05 12:28:37 -0400
committerJames Moger <james.moger@gitblit.com>2014-07-05 12:28:37 -0400
commit34d7d04aa8a1a7706be333f5eb0a4aec7f066850 (patch)
tree4439c235180ca7479f2a0af69de765e3a6a7837b /src
parenta40cbcfc4fab2ca16304c7393a68fe95a9322edc (diff)
parent498cdca0cc3a7545311877a0fb43586ef113a801 (diff)
downloadgitblit-34d7d04aa8a1a7706be333f5eb0a4aec7f066850.tar.gz
gitblit-34d7d04aa8a1a7706be333f5eb0a4aec7f066850.zip
Merge branch 'ticket/137' into develop
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/gitblit/servlet/RawServlet.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/servlet/RawServlet.java b/src/main/java/com/gitblit/servlet/RawServlet.java
index 7731a95f..498eaf1f 100644
--- a/src/main/java/com/gitblit/servlet/RawServlet.java
+++ b/src/main/java/com/gitblit/servlet/RawServlet.java
@@ -261,6 +261,15 @@ public class RawServlet extends HttpServlet {
// load, interpret, and serve text content as UTF-8
String [] encodings = runtimeManager.getSettings().getStrings(Keys.web.blobEncodings).toArray(new String[0]);
String content = JGitUtils.getStringContent(r, commit.getTree(), requestedPath, encodings);
+ if (content == null) {
+ logger.error("RawServlet Failed to load {} {} {}", repository, commit.getName(), path);
+ String str = MessageFormat.format(
+ "# Error\nSorry, the requested resource **{0}** was not found.",
+ requestedPath);
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ error(response, str);
+ return;
+ }
byte [] bytes = content.getBytes(Constants.ENCODING);
response.setContentLength(bytes.length);