Skip to content

Commit

Permalink
Don't overwrite final get URI with empty string (#14678)
Browse files Browse the repository at this point in the history
* Don't overwrite final get URI with empty string

If the success response doesn't return a final get URI used the value
that was previously calculated.

* add license and update version
  • Loading branch information
jhendrixMSFT committed May 19, 2021
1 parent 00e7775 commit 57de692
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
21 changes: 21 additions & 0 deletions sdk/armcore/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2021 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 6 additions & 2 deletions sdk/armcore/poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,13 +623,17 @@ func (pt *pollingTrackerBase) setFinalState() error {
if err != nil {
return err
}
pt.FinalGetURI = ao
if ao != "" {
pt.FinalGetURI = ao
}
} else if pt.FinalStateVia == "location" {
lh, err := getURLFromLocationHeader(pt.latestResponse())
if err != nil {
return err
}
pt.FinalGetURI = lh
if lh != "" {
pt.FinalGetURI = lh
}
} else if pt.FinalStateVia == "original-uri" {
pt.FinalGetURI = pt.OriginalURI
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/armcore/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ const (
UserAgent = "armcore/" + Version

// Version is the semantic version (see http://semver.org) of this module.
Version = "v0.7.0"
Version = "v0.7.1"
)

0 comments on commit 57de692

Please sign in to comment.