| | |
| | | import java.util.Map; |
| | | import java.util.TreeMap; |
| | | |
| | | import com.google.inject.Inject; |
| | | import com.google.inject.Singleton; |
| | | import javax.servlet.ServletContext; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServlet; |
| | |
| | | import com.gitblit.utils.JGitUtils; |
| | | import com.gitblit.utils.MarkdownUtils; |
| | | import com.gitblit.utils.StringUtils; |
| | | import com.google.inject.Inject; |
| | | import com.google.inject.Singleton; |
| | | |
| | | /** |
| | | * Serves the content of a branch. |
| | |
| | | } |
| | | } |
| | | |
| | | if (isTextType(contentType)) { |
| | | if (isTextType(contentType) || isTextDataType(contentType)) { |
| | | |
| | | // load, interpret, and serve text content as UTF-8 |
| | | String [] encodings = runtimeManager.getSettings().getStrings(Keys.web.blobEncodings).toArray(new String[0]); |
| | |
| | | return false; |
| | | } |
| | | |
| | | protected boolean isTextDataType(String contentType) { |
| | | if ("image/svg+xml".equals(contentType)) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * Override all text types to be plain text. |
| | | * |