Skip to content

Commit

Permalink
feat: return 403 if not in kgp
Browse files Browse the repository at this point in the history
  • Loading branch information
proffapt committed Jul 2, 2024
1 parent 3867937 commit 4a702c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ func handleCampusCheck(res http.ResponseWriter, req *http.Request) {
netname := match[1]
if netname == "IITKGP-IN" {
response["is_inside_kgp"] = true
res.WriteHeader(http.StatusAccepted)
} else {
response["is_inside_kgp"] = false
res.WriteHeader(http.StatusUnauthorized)
}
} else {
fmt.Println("Netname not found in the whois response.")
Expand Down

0 comments on commit 4a702c5

Please sign in to comment.