From a502d96a860456ec5e8c96761db70f7cabb74751 Mon Sep 17 00:00:00 2001 From: Paul Martin <paul@paulsputer.com> Date: Sat, 30 Apr 2016 04:19:14 -0400 Subject: [PATCH] Merge pull request #1073 from gitblit/1062-DocEditorUpdates --- src/main/java/com/gitblit/servlet/GitFilter.java | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gitblit/servlet/GitFilter.java b/src/main/java/com/gitblit/servlet/GitFilter.java index 27408f0..9522893 100644 --- a/src/main/java/com/gitblit/servlet/GitFilter.java +++ b/src/main/java/com/gitblit/servlet/GitFilter.java @@ -102,8 +102,8 @@ } /** - * Analyze the url and returns the action of the request. Return values are - * either "/git-receive-pack" or "/git-upload-pack". + * Analyze the url and returns the action of the request. Return values are: + * "/git-receive-pack", "/git-upload-pack" or "/info/lfs". * * @param serverUrl * @return action of the request @@ -316,18 +316,22 @@ /** * Git lfs action uses an alternative authentication header, + * dependent on the viewing method. * + * @param httpRequest * @param action * @return */ @Override - protected String getAuthenticationHeader(String action) { + protected String getAuthenticationHeader(HttpServletRequest httpRequest, String action) { if (action.equals(gitLfs)) { - return "LFS-Authenticate"; + if (hasContentInRequestHeader(httpRequest, "Accept", FilestoreServlet.GIT_LFS_META_MIME)) { + return "LFS-Authenticate"; + } } - return super.getAuthenticationHeader(action); + return super.getAuthenticationHeader(httpRequest, action); } /** -- Gitblit v1.9.1