Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong check for redirect? #480

Merged
merged 2 commits into from Jan 15, 2022
Merged

Wrong check for redirect? #480

merged 2 commits into from Jan 15, 2022

Conversation

jaadams5
Copy link
Contributor

Old code actually triggers for non-redirect status codes, I believe. Am I right?

@jaadams5 jaadams5 requested a review from a team as a code owner January 15, 2022 19:27
@@ -84,8 +84,7 @@ private static String readWikiData(String url) {
byte[] bytes = ByteBufferUtilities.read(istream);
return StringUtilities.getEncodedString(bytes, "UTF-8");
}
// JAA - Should this be && and not || ?
if (responseCode >= 301 || responseCode < 308) {
if (301 <= responseCode && responseCode <= 308) {
Copy link
Contributor Author

@jaadams5 jaadams5 Jan 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old code triggered the conditional if responseCode <= 301. So the comparison to 308 was never made. 308 is a permanent redirect and in context I think the code would want to follow it.

@Veracity0 Veracity0 merged commit 65eb504 into main Jan 15, 2022
@Veracity0 Veracity0 deleted the redirect branch January 15, 2022 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants