File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
opengrok-web/src/test/java/org/opengrok/web Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -657,6 +657,26 @@ public String getPathInfo() {
657657 };
658658 }
659659
660+ @ Test
661+ void testIsNotModifiedNullHeaderEtag () throws IOException {
662+ HttpServletRequest req = new DummyHttpServletRequest () {
663+ @ Override
664+ public String getHeader (String name ) {
665+ return null ;
666+ }
667+
668+ @ Override
669+ public String getPathInfo () {
670+ return "path" ;
671+ }
672+ };
673+
674+ PageConfig cfg = PageConfig .get (req );
675+ HttpServletResponse resp = mock (HttpServletResponse .class );
676+ assertFalse (cfg .isNotModified (req , resp ));
677+ verify (resp ).setHeader (eq (HttpHeaders .ETAG ), startsWith ("W/" ));
678+ }
679+
660680 @ ParameterizedTest
661681 @ ValueSource (booleans = {true , false })
662682 void testIsNotModifiedEtag (boolean createTimestamp ) throws IOException {
You can’t perform that action at this time.
0 commit comments