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

Loading…
Cancel
Save