Skip to content

Commit f4d3307

Browse files
committed
response "Server" HTTP headr with version of SQLiteQueryServer
1 parent 142603a commit f4d3307

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ echo -e "github.com\none.one.one.one\ngoogle-public-dns-a.google.com" | curl "ht
8686
]
8787
```
8888

89-
- Response is a JSON array (Content-Type: application/json).
89+
- Response is a JSON array (`Content-Type: application/json`).
9090
- Each element in the array:
9191
- Is a result of a query
9292
- Has an "in" fields which is an array of the input params (a request body line).

main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import (
1414
_ "github.com/mattn/go-sqlite3"
1515
)
1616

17+
const version = "1.0.0"
18+
1719
var db *sql.DB
1820
var queryStmt *sql.Stmt
1921

@@ -70,6 +72,8 @@ func main() {
7072
}
7173

7274
func query(w http.ResponseWriter, r *http.Request) {
75+
w.Header().Set("Server", "SQLiteQueryServer v"+version)
76+
7377
if r.URL.Path != "/query" {
7478
http.Error(w, helpMessage, http.StatusNotFound)
7579
return

0 commit comments

Comments
 (0)