Changeset a845d4f


Ignore:
Timestamp:
Mar 9, 2018 4:02:00 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
44c38df
Parents:
9dcf48ea
Message:

Servlets: Add Accept-Ranges headers

Location:
apps
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/web/BasicServlet.java

    r9dcf48ea ra845d4f  
    385385            response.setDateHeader("Last-Modified",lml);
    386386
    387         if (count != -1)
    388         {
    389             if (count<Integer.MAX_VALUE)
     387        if (count != -1) {
     388            if (count <= Integer.MAX_VALUE)
    390389                response.setContentLength((int)count);
    391390            else
    392391                response.setHeader("Content-Length", Long.toString(count));
     392            response.setHeader("Accept-Ranges", "bytes");
     393        } else {
     394            response.setHeader("Accept-Ranges", "none");
    393395        }
    394396
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r9dcf48ea ra845d4f  
    405405        resp.setHeader("X-Content-Type-Options", "nosniff");
    406406        resp.setHeader("Referrer-Policy", "no-referrer");
     407        resp.setHeader("Accept-Ranges", "none");
    407408    }
    408409
  • apps/i2ptunnel/jsp/edit.jsp

    r9dcf48ea ra845d4f  
    88    response.setHeader("X-Content-Type-Options", "nosniff");
    99    response.setHeader("Referrer-Policy", "no-referrer");
     10    response.setHeader("Accept-Ranges", "none");
    1011
    1112%><%@page pageEncoding="UTF-8"
  • apps/i2ptunnel/jsp/index.jsp

    r9dcf48ea ra845d4f  
    1111    response.setHeader("X-Content-Type-Options", "nosniff");
    1212    response.setHeader("Referrer-Policy", "no-referrer");
     13    response.setHeader("Accept-Ranges", "none");
    1314
    1415%><%@page pageEncoding="UTF-8"
  • apps/i2ptunnel/jsp/register.jsp

    r9dcf48ea ra845d4f  
    77    response.setHeader("X-Content-Type-Options", "nosniff");
    88    response.setHeader("Referrer-Policy", "no-referrer");
     9    response.setHeader("Accept-Ranges", "none");
    910
    1011%><%@page pageEncoding="UTF-8"
  • apps/i2ptunnel/jsp/wizard.jsp

    r9dcf48ea ra845d4f  
    1111    response.setHeader("X-Content-Type-Options", "nosniff");
    1212    response.setHeader("Referrer-Policy", "no-referrer");
     13    response.setHeader("Accept-Ranges", "none");
    1314
    1415%><%@page pageEncoding="UTF-8"
  • apps/imagegen/imagegen/webapp/src/main/java/net/i2p/imagegen/IdenticonServlet.java

    r9dcf48ea ra845d4f  
    168168                        response.setContentType(IDENTICON_IMAGE_MIMETYPE);
    169169                        response.setHeader("X-Content-Type-Options", "nosniff");
     170                        response.setHeader("Accept-Ranges", "none");
    170171                        response.setContentLength(imageBytes.length);
    171172                        response.getOutputStream().write(imageBytes);
  • apps/imagegen/imagegen/webapp/src/main/java/net/i2p/imagegen/QRServlet.java

    r9dcf48ea ra845d4f  
    194194                        response.setContentType(IDENTICON_IMAGE_MIMETYPE);
    195195                        response.setHeader("X-Content-Type-Options", "nosniff");
     196                        response.setHeader("Accept-Ranges", "none");
    196197                        response.setContentLength(imageBytes.length);
    197198                        response.getOutputStream().write(imageBytes);
  • apps/imagegen/imagegen/webapp/src/main/java/net/i2p/imagegen/RandomArtServlet.java

    r9dcf48ea ra845d4f  
    6464                                }
    6565                                response.setHeader("X-Content-Type-Options", "nosniff");
     66                                response.setHeader("Accept-Ranges", "none");
    6667                                buf.append(RandomArt.gnutls_key_fingerprint_randomart(h.getData(), "SHA", 256, "", true, html));
    6768                                if (html)
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/CodedIconRendererServlet.java

    r9dcf48ea ra845d4f  
    4444         srs.setContentType("image/png");
    4545         srs.setHeader("X-Content-Type-Options", "nosniff");
     46         srs.setHeader("Accept-Ranges", "none");
    4647         srs.setDateHeader("Expires", I2PAppContext.getGlobalContext().clock().now() + 86400000l);
    4748         srs.setHeader("Cache-Control", "public, max-age=86400");
  • apps/routerconsole/jsp/css.jsi

    r9dcf48ea ra845d4f  
    3030<link rel="icon" href="<%=intl.getTheme(request.getHeader("User-Agent"))%>images/favicon.ico">
    3131<%
     32   response.setHeader("Accept-Ranges", "none");
     33
    3234   // clickjacking
    3335   if (intl.shouldSendXFrame()) {
  • apps/routerconsole/jsp/exportfamily.jsp

    r9dcf48ea ra845d4f  
    1818    try {
    1919        response.setDateHeader("Expires", 0);
     20        response.setHeader("Accept-Ranges", "none");
    2021        response.addHeader("Cache-Control", "no-store, max-age=0, no-cache, must-revalidate");
    2122        response.addHeader("Pragma", "no-cache");
  • apps/routerconsole/jsp/flags.jsp

    r9dcf48ea ra845d4f  
    4545        response.setHeader("Content-Length", Long.toString(length));
    4646    response.setContentType("image/png");
     47    response.setHeader("Accept-Ranges", "none");
    4748    try {
    4849        net.i2p.util.FileUtil.readFile(file, base, cout);
  • apps/routerconsole/jsp/viewhistory.jsp

    r9dcf48ea ra845d4f  
    99response.setContentType("text/plain");
    1010response.setHeader("X-Content-Type-Options", "nosniff");
     11response.setHeader("Accept-Ranges", "none");
    1112response.setDateHeader("Expires", 0);
    1213response.addHeader("Cache-Control", "no-store, max-age=0, no-cache, must-revalidate");
  • apps/routerconsole/jsp/viewrouterlog.jsp

    r9dcf48ea ra845d4f  
    1717    response.setContentType("text/plain");
    1818    response.setHeader("X-Content-Type-Options", "nosniff");
     19    response.setHeader("Accept-Ranges", "none");
    1920    response.setHeader("Content-Length", Long.toString(length));
    2021    response.setDateHeader("Expires", 0);
  • apps/routerconsole/jsp/viewstat.jsp

    r9dcf48ea ra845d4f  
    4646        // very brief 45 sec expire
    4747        response.setDateHeader("Expires", net.i2p.I2PAppContext.getGlobalContext().clock().now() + (45*1000));
     48        response.setHeader("Accept-Ranges", "none");
    4849        // http://jira.codehaus.org/browse/JETTY-1346
    4950        // This doesn't actually appear in the response, but it fixes the problem,
  • apps/routerconsole/jsp/viewtheme.jsp

    r9dcf48ea ra845d4f  
    2222  response.setContentType("image/svg+xml");
    2323}
     24response.setHeader("Accept-Ranges", "none");
    2425response.setHeader("X-Content-Type-Options", "nosniff");
    2526/*
  • apps/routerconsole/jsp/viewwrapperlog.jsp

    r9dcf48ea ra845d4f  
    1616    response.setHeader("X-Content-Type-Options", "nosniff");
    1717    response.setHeader("Content-Length", Long.toString(length));
     18    response.setHeader("Accept-Ranges", "none");
    1819    response.setDateHeader("Expires", 0);
    1920    response.addHeader("Cache-Control", "no-store, max-age=0, no-cache, must-revalidate");
  • apps/susidns/src/jsp/addressbook.jsp

    r9dcf48ea ra845d4f  
    3333    response.setHeader("X-Content-Type-Options", "nosniff");
    3434    response.setHeader("Referrer-Policy", "no-referrer");
     35    response.setHeader("Accept-Ranges", "none");
    3536
    3637%>
  • apps/susidns/src/jsp/config.jsp

    r9dcf48ea ra845d4f  
    3333    response.setHeader("X-Content-Type-Options", "nosniff");
    3434    response.setHeader("Referrer-Policy", "no-referrer");
     35    response.setHeader("Accept-Ranges", "none");
    3536
    3637%>
  • apps/susidns/src/jsp/details.jsp

    r9dcf48ea ra845d4f  
    3030    response.setHeader("X-Content-Type-Options", "nosniff");
    3131    response.setHeader("Referrer-Policy", "no-referrer");
     32    response.setHeader("Accept-Ranges", "none");
    3233
    3334%>
  • apps/susidns/src/jsp/export.jsp

    r9dcf48ea ra845d4f  
    2525        request.setCharacterEncoding("UTF-8");
    2626    response.setHeader("X-Content-Type-Options", "nosniff");
     27    response.setHeader("Accept-Ranges", "none");
    2728%>
    2829<%@page pageEncoding="UTF-8"%>
  • apps/susidns/src/jsp/index.jsp

    r9dcf48ea ra845d4f  
    3333    response.setHeader("X-Content-Type-Options", "nosniff");
    3434    response.setHeader("Referrer-Policy", "no-referrer");
     35    response.setHeader("Accept-Ranges", "none");
    3536
    3637%>
  • apps/susidns/src/jsp/subscriptions.jsp

    r9dcf48ea ra845d4f  
    3333    response.setHeader("X-Content-Type-Options", "nosniff");
    3434    response.setHeader("Referrer-Policy", "no-referrer");
     35    response.setHeader("Accept-Ranges", "none");
    3536
    3637%>
  • apps/susimail/src/src/i2p/susi/webmail/WebMail.java

    r9dcf48ea ra845d4f  
    19121912                response.setHeader("X-Content-Type-Options", "nosniff");
    19131913                response.setHeader("Referrer-Policy", "no-referrer");
     1914                response.setHeader("Accept-Ranges", "none");
    19141915                RequestWrapper request = new RequestWrapper( httpRequest );
    19151916               
Note: See TracChangeset for help on using the changeset viewer.