Browse Source

fix panic that happens when publishing to a path with source = redirect (#933)

pull/956/head
aler9 4 years ago
parent
commit
98b3538289
  1. 8
      internal/core/path.go

8
internal/core/path.go

@ -762,13 +762,15 @@ func (pa *path) handlePublisherRemove(req pathPublisherRemoveReq) {
func (pa *path) handlePublisherAnnounce(req pathPublisherAnnounceReq) { func (pa *path) handlePublisherAnnounce(req pathPublisherAnnounceReq) {
if pa.source != nil { if pa.source != nil {
if pa.hasStaticSource() { if pa.conf.Source != "publisher" {
req.res <- pathPublisherAnnounceRes{err: fmt.Errorf("path '%s' is assigned to a static source", pa.name)} req.res <- pathPublisherAnnounceRes{
err: fmt.Errorf("can't publish to path '%s' since 'source' is not 'publisher'", pa.name),
}
return return
} }
if pa.conf.DisablePublisherOverride { if pa.conf.DisablePublisherOverride {
req.res <- pathPublisherAnnounceRes{err: fmt.Errorf("another publisher is already publishing to path '%s'", pa.name)} req.res <- pathPublisherAnnounceRes{err: fmt.Errorf("someone is already publishing to path '%s'", pa.name)}
return return
} }

Loading…
Cancel
Save