Compare commits
No commits in common. "2e83a023f586832b603a0b52ac09536aaa6bc74c" and "b34604607d4b254989c8f3252486b1b8ca779d89" have entirely different histories.
2e83a023f5
...
b34604607d
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/garyburd/redigo/redis"
|
"github.com/garyburd/redigo/redis"
|
||||||
"github.com/pstuifzand/ekster/microsub"
|
"github.com/pstuifzand/ekster/microsub"
|
||||||
|
|
@ -32,11 +31,6 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
if r.Method == http.MethodPost {
|
if r.Method == http.MethodPost {
|
||||||
sourceID := r.URL.Query().Get("source_id")
|
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))
|
channel, err := redis.String(conn.Do("HGET", "sources", sourceID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, "Unknown source", 400)
|
http.Error(w, "Unknown source", 400)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user