Compare commits
2 Commits
b34604607d
...
2e83a023f5
Author | SHA1 | Date | |
---|---|---|---|
2e83a023f5 | |||
9625549a5f |
|
@ -6,6 +6,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/garyburd/redigo/redis"
|
||||
"github.com/pstuifzand/ekster/microsub"
|
||||
|
@ -31,6 +32,11 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
if r.Method == http.MethodPost {
|
||||
sourceID := r.URL.Query().Get("source_id")
|
||||
|
||||
authHeader := r.Header.Get("Authorization")
|
||||
if strings.HasPrefix(authHeader, "Bearer ") {
|
||||
sourceID = authHeader[7:]
|
||||
}
|
||||
|
||||
channel, err := redis.String(conn.Do("HGET", "sources", sourceID))
|
||||
if err != nil {
|
||||
http.Error(w, "Unknown source", 400)
|
||||
|
|
Loading…
Reference in New Issue
Block a user