Skip to content

Commit

Permalink
Handle target in OpenInApp response
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Jul 24, 2023
1 parent 7c8eb90 commit 57f0287
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/http/services/appprovider/appprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ func (s *svc) handleOpen(w http.ResponseWriter, r *http.Request) {
}

log := appctx.GetLogger(ctx)
log.Info().Str("url", openRes.AppUrl.AppUrl).Interface("resource", fileRef).Msg("returning app URL for file")
log.Info().Interface("resource", fileRef).Str("url", openRes.AppUrl.AppUrl).Str("method", openRes.AppUrl.Method).Interface("target", openRes.AppUrl.Target).Msg("returning app URL for file")

w.Header().Set("Content-Type", "application/json")
if _, err = w.Write(js); err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/app/provider/demo/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (p *demoProvider) GetAppURL(ctx context.Context, resource *provider.Resourc
return &appprovider.OpenInAppURL{
AppUrl: url,
Method: http.MethodGet,
Target: appprovider.Target_TARGET_IFRAME, // alternatively, appprovider.Target_TARGET_BLANK
}, nil
}

Expand Down
1 change: 1 addition & 0 deletions pkg/app/provider/wopi/wopi.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ func (p *wopiProvider) GetAppURL(ctx context.Context, resource *provider.Resourc
AppUrl: appFullURL,
Method: method,
FormParameters: formParams,
Target: appprovider.Target_TARGET_IFRAME,
}, nil
}

Expand Down

0 comments on commit 57f0287

Please sign in to comment.