aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-28 15:52:22 -0800
committerFChannel <=>2021-01-28 15:52:22 -0800
commitee30189224579977a6c4d27aba4e1f0aacd91d57 (patch)
tree9a1dac812f03f276ab7e73bcdee1dd6ad3261d52 /main.go
parentcda2d90030a80731faa94977a13fcf09220e31ea (diff)
removed \n from tripcode
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/main.go b/main.go
index e03bae6..a430387 100644
--- a/main.go
+++ b/main.go
@@ -422,7 +422,7 @@ func main() {
CheckError(err, "error with follow req")
_, pass := GetPasswordFromSession(r)
-
+
req.Header.Set("Authorization", "Basic " + pass)
req.Header.Set("Content-Type", activitystreams)
@@ -899,7 +899,9 @@ func CreateTripCode(input string) string {
CheckError(err, "error with create trip code")
- return out.String()
+ code := strings.Split(out.String(), " ")
+
+ return code[0]
}
func CreateNameTripCode(input string) string {
@@ -1615,7 +1617,10 @@ func MakeActivityRequest(db *sql.DB, activity Activity) {
req, err := http.NewRequest("POST", actor.Inbox, bytes.NewBuffer(j))
req.Header.Set("Content-Type", activitystreams)
- req.Header.Set("Authorization", "Basic " + auth)
+
+ if activity.Type == "Create" {
+ req.Header.Set("Authorization", "Basic " + auth)
+ }
CheckError(err, "error with sending activity req to")