Skip to content

Commit

Permalink
Version 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Jun 8, 2024
1 parent 1c4b20e commit 71467db
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github_changelog_generator
Original file line number Diff line number Diff line change
@@ -1 +1 @@
future-release=1.1.0
future-release=1.1.2
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [1.1.1](https://github.com/ethauvin/httpstatus/tree/1.1.1) (2024-06-07)

[Full Changelog](https://github.com/ethauvin/httpstatus/compare/1.1.0...1.1.1)

**Implemented enhancements:**

- Sort command line output [\#10](https://github.com/ethauvin/HttpStatus/issues/10)
- Update reasons properties status codes [\#9](https://github.com/ethauvin/HttpStatus/issues/9)

## [1.1.0](https://github.com/ethauvin/httpstatus/tree/1.1.0) (2023-09-29)

[Full Changelog](https://github.com/ethauvin/httpstatus/compare/1.0.5...1.1.0)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ repositories {
}
dependencies {
implementation 'net.thauvin.erik.httpstatus:httpstatus:1.1.0'
implementation 'net.thauvin.erik.httpstatus:httpstatus:1.1.1'
}
```

Expand All @@ -94,7 +94,7 @@ As a `Maven` artifact:
<dependency>
<groupId>net.thauvin.erik.httpstatus</groupId>
<artifactId>httpstatus</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
</dependency>
```

Expand Down Expand Up @@ -315,15 +315,15 @@ The reasons are defined in a [ResourceBundle](https://docs.oracle.com/en/java/ja
You can query the reason phrase for status codes as follows:

```console
$ java -jar httpstatus-1.1.0.jar 404 500
$ java -jar httpstatus-1.1.1.jar 404 500
404: Not Found
500: Internal Server Error
```

If no status code is specified, all will be printed:

```console
$ java -jar httpstatus-1.1.0.jar
$ java -jar httpstatus-1.1.1.jar
100: Continue
101: Switching Protocols
102: Processing
Expand All @@ -343,7 +343,7 @@ $ java -jar httpstatus-1.1.0.jar
You can also print status codes by [response classes](https://www.rfc-editor.org/rfc/rfc9110.html#name-status-codes):

```console
$ java -jar httpstatus-1.1.0.jar 2xx
$ java -jar httpstatus-1.1.1.jar 2xx
200: OK
201: Created
202: Accepted
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.thauvin.erik.httpstatus</groupId>
<artifactId>httpstatus</artifactId>
<version>1.1.1-SNAPSHOT</version>
<version>1.1.1</version>
<name>HttpStatus</name>
<description>Tag library to display the code, reason, cause and/or message for HTTP status codes in JSP error pages</description>
<url>https://github.com/ethauvin/HttpStatus</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class HttpStatusBuild extends Project {
public HttpStatusBuild() {
pkg = "net.thauvin.erik.httpstatus";
name = "HttpStatus";
version = version(1, 1, 1, "SNAPSHOT");
version = version(1, 1, 1);

var description = "Tag library to display the code, reason, cause and/or message for HTTP status codes in JSP error pages";
var url = "https://github.com/ethauvin/HttpStatus";
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/net/thauvin/erik/httpstatus/Reasons.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,23 @@ public static String getReasonPhrase(String statusCode) {
public static void main(String... args) {
var keys = new TreeSet<>(REASON_PHRASES.keySet());
if (args.length >= 1) {
for (var key : args) {
if (key.endsWith("xx")) {
var responseClass = key.charAt(0);
keys.forEach((k) -> {
for (var arg : args) {
if (arg.endsWith("xx")) { // e.g.: 2xx
var responseClass = arg.charAt(0);
keys.forEach(k -> {
if (k.charAt(0) == responseClass) {
System.out.println(k + ": " + REASON_PHRASES.get(k));
}
});
} else {
var value = REASON_PHRASES.get(key);
} else { // e.g.: 404
var value = REASON_PHRASES.get(arg);
if (value != null) {
System.out.println(key + ": " + value);
System.out.println(arg + ": " + value);
}
}
}
} else {
keys.forEach((k) -> System.out.println(k + ": " + REASON_PHRASES.get(k)));
} else { // Print all
keys.forEach(k -> System.out.println(k + ": " + REASON_PHRASES.get(k)));
System.out.println("Total: " + REASON_PHRASES.size());
}
}
Expand Down

0 comments on commit 71467db

Please sign in to comment.