From 11c65f46215fee9a436a0e25b2f968a883240771 Mon Sep 17 00:00:00 2001 From: Clown <3148835359@qq.com> Date: Tue, 12 Nov 2024 19:27:21 +0800 Subject: [PATCH] fix GitHub notification interface return "Unable to parse If-Modified-Since request header" --- src/main/java/org/kohsuke/github/GHNotificationStream.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/kohsuke/github/GHNotificationStream.java b/src/main/java/org/kohsuke/github/GHNotificationStream.java index 7e62d7b6c6..f769907125 100644 --- a/src/main/java/org/kohsuke/github/GHNotificationStream.java +++ b/src/main/java/org/kohsuke/github/GHNotificationStream.java @@ -187,7 +187,9 @@ GHThread fetch() { Thread.sleep(waitTime); } - req.setHeader("If-Modified-Since", lastModified); + if (lastModified != null) { + req.setHeader("If-Modified-Since", lastModified); + } Requester requester = req.withUrlPath(apiUrl); GitHubResponse response = ((GitHubPageContentsIterable) requester