]> Lady’s Gitweb - Gitweb/commit
gitweb: Serve text/* 'blob_plain' as text/plain with $prevent_xss
authorJakub Narebski <redacted>
Thu, 30 Jun 2011 09:39:20 +0000 (11:39 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:31 +0000 (00:51 -0400)
commitb62b94d2c6dc37b4ab40aa5af97e770794b47187178c62761e57e7794f7d2f31
tree57ed48a5b93bc065d9c5047530be3fd4c94ef2af185c3fa0acfe251a7a193b7a
parent5a2e5c94a72bced582800308a3a24442a6cb93da9fe0bf0d59b2142b4aebd0b1
gitweb: Serve text/* 'blob_plain' as text/plain with $prevent_xss

One of mechanism enabled by setting $prevent_xss to true is 'blob_plain'
view protection.  With XSS prevention on, blobs of all types except a
few known safe ones are served with "Content-Disposition: attachment" to
make sure they don't run in our security domain.

Instead of serving text/* type files, except text/plain (and including
text/html), as attachements, downgrade it to text/plain.  This way HTML
pages in 'blob_plain' (raw) view would be displayed in browser, but
safely as a source, and not asked to be saved.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.219771 seconds and 4 git commands to generate.