17
17
18
18
/**
19
19
* Check html anchor href attributes
20
+ *
20
21
* @see <a href="https://www.w3schools.com/tags/att_a_href.asp">https://www.w3schools.com/tags/att_a_href.asp</a>
21
22
*/
22
23
class BrokenHttpLinksChecker extends Checker {
@@ -35,9 +36,9 @@ class BrokenHttpLinksChecker extends Checker {
35
36
BrokenHttpLinksChecker (Configuration pConfig ) {
36
37
super (pConfig );
37
38
38
- errorCodes = getMyConfig ().getHttpErrorCodes ();
39
- warningCodes = getMyConfig ().getHttpWarningCodes ();
40
- successCodes = getMyConfig ().getHttpSuccessCodes ();
39
+ errorCodes = getMyConfig ().getHttpErrorCodes ();
40
+ warningCodes = getMyConfig ().getHttpWarningCodes ();
41
+ successCodes = getMyConfig ().getHttpSuccessCodes ();
41
42
}
42
43
43
44
@ Override
@@ -129,7 +130,7 @@ else if (Web.HTTP_REDIRECT_CODES.contains(responseCode)) {
129
130
if (firstConnection .getHeaderField ("Location" ) != null ) {
130
131
newLocation = firstConnection .getHeaderField ("Location" );
131
132
132
- problem = "Warning: " + href + " returned statuscode " + responseCode + " , new location: " + newLocation ;
133
+ problem = String . format ( "Warning: %s returned statuscode %d , new location: %s" , href , responseCode , newLocation ) ;
133
134
getCheckingResults ().addFinding (new Finding (problem ));
134
135
135
136
}
@@ -152,7 +153,7 @@ else if (Web.HTTP_REDIRECT_CODES.contains(responseCode)) {
152
153
problem = "Error: Unknown or unclassified response code:" ;
153
154
}
154
155
155
- problem += String .format ("'%s' returned statuscode %d." , href , responseCode );
156
+ problem += String .format (" %s returned statuscode %d." , href , responseCode );
156
157
157
158
getCheckingResults ().addFinding (new Finding (problem ));
158
159
0 commit comments