Skip to content

Commit

Permalink
Set default FIWARE Service Path to '/' in cp command
Browse files Browse the repository at this point in the history
  • Loading branch information
fisuda committed Jul 17, 2021
1 parent 3a6260c commit d338633
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NGSI Go v0.8.4-next

- Improve: Set default FIWARE Service Path to "/" in cp command (#180)
- Improve: Set default FIWARE Service Path to "/" in rm command (#179)
- Hardening: Support Kong (#178)
- Hardening: Add insecureSkipVerify option (#177)
Expand Down
9 changes: 9 additions & 0 deletions internal/ngsicmd/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ func copy(c *cli.Context) error {
return &ngsiCmdError{funcName, 7, "source and destination are same", nil}
}

if source.IsNgsiV2() && source.Scope == "" {
source.Scope = "/"
source.Headers["Fiware-ServicePath"] = "/"
}
if destination.IsNgsiV2() && destination.Scope == "" {
destination.Scope = "/"
destination.Headers["Fiware-ServicePath"] = "/"
}

if source.IsNgsiV2() && destination.IsNgsiV2() {
if c.Bool("ngsiV1") {
f = copyV1V1
Expand Down

0 comments on commit d338633

Please sign in to comment.