Skip to content

Commit

Permalink
update s
Browse files Browse the repository at this point in the history
  • Loading branch information
Baiqll committed Jun 10, 2024
1 parent 4310990 commit 137cb6d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"path/filepath"
"regexp"
"strings"
"time"

"github.com/baiqll/src-http/src/cert"
"github.com/baiqll/src-http/src/lib"
Expand Down Expand Up @@ -122,7 +121,7 @@ func http_server(server string, tls_crt string, tls_key string, payload string,
}
fmt.Print("\n")

if(strings.HasPrefix(r.URL, "/default")){
if(strings.HasPrefix(r.URL.String(), "/default")){
data, err := ioutil.ReadFile(default_file)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
Expand All @@ -131,11 +130,11 @@ func http_server(server string, tls_crt string, tls_key string, payload string,

http_write(w,data)

}else if(strings.HasPrefix(r.URL, "/Payload")){
}else if(strings.HasPrefix(r.URL.String(), "/Payload")){

http_write(w,[]byte(payload))

}else if(strings.HasPrefix(r.URL, "/message")){
}else if(strings.HasPrefix(r.URL.String(), "/message")){

http_write(w,[]byte(`{"message": "OK"}`))

Expand Down

0 comments on commit 137cb6d

Please sign in to comment.