Merge pull request #343 from gabriel-samfira/relax-webhook-url
Relax URLs validation
This commit is contained in:
commit
d4ce174bab
2 changed files with 2 additions and 2 deletions
|
|
@ -39,6 +39,6 @@ var (
|
|||
// URLsRequired is returned if the controller does not have the required URLs
|
||||
URLsRequired = APIErrorResponse{
|
||||
Error: "urls_required",
|
||||
Details: "Missing required URLs. Make sure you update the metadata, callback and webhook URLs",
|
||||
Details: "Missing required URLs. Make sure you update the metadata and callback URLs",
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ func (u *urlsRequired) Middleware(next http.Handler) http.Handler {
|
|||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
ctrlInfo, err := u.store.ControllerInfo()
|
||||
if err != nil || ctrlInfo.WebhookURL == "" || ctrlInfo.MetadataURL == "" || ctrlInfo.CallbackURL == "" {
|
||||
if err != nil || ctrlInfo.MetadataURL == "" || ctrlInfo.CallbackURL == "" {
|
||||
w.Header().Add("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusConflict)
|
||||
if err := json.NewEncoder(w).Encode(params.URLsRequired); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue