fix url logging (#2617)
## Description The `GetUri()` call contains side-effects which drain the builder of its constructed url data. As a result, running a backup with CORSO_URL_LOGGING actually forces the bug to manifest unintentionally. ## Does this PR need a docs update or release note? - [x] ✅ Yes, it's included ## Type of change - [x] 🐛 Bugfix ## Test Plan - [x] 💪 Manual
This commit is contained in:
parent
a9f8c33261
commit
129b96714b
@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Errors from duplicate names in Exchange Calendars
|
- Errors from duplicate names in Exchange Calendars
|
||||||
- Resolved an issue where progress bar displays could fail to exit, causing unbounded CPU consumption.
|
- Resolved an issue where progress bar displays could fail to exit, causing unbounded CPU consumption.
|
||||||
- Fix Corso panic within Docker images
|
- Fix Corso panic within Docker images
|
||||||
|
- Debugging with the CORSO_URL_LOGGING env variable no longer causes accidental request failures.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- When using Restore and Details on Exchange Calendars, the `--event-calendar` flag can now identify calendars by either a Display Name or a Microsoft 365 ID.
|
- When using Restore and Details on Exchange Calendars, the `--event-calendar` flag can now identify calendars by either a Display Name or a Microsoft 365 ID.
|
||||||
@ -28,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Known Issues
|
### Known Issues
|
||||||
- Nested attachments are currently not restored due to an [issue](https://github.com/microsoft/kiota-serialization-json-go/issues/61) discovered in the Graph APIs
|
- Nested attachments are currently not restored due to an [issue](https://github.com/microsoft/kiota-serialization-json-go/issues/61) discovered in the Graph APIs
|
||||||
- Breaking changes to Exchange Calendar backups.
|
- Breaking changes to Exchange Calendar backups.
|
||||||
|
- The debugging env variable CORSO_URL_LOGGING causes exchange get requests to fail.
|
||||||
|
|
||||||
## [v0.3.0] (alpha) - 2023-2-07
|
## [v0.3.0] (alpha) - 2023-2-07
|
||||||
|
|
||||||
|
|||||||
@ -252,12 +252,9 @@ func (c Contacts) GetAddedAndRemovedItemIDs(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Ctx(ctx).Errorw("getting builder info", "error", err)
|
logger.Ctx(ctx).Errorw("getting builder info", "error", err)
|
||||||
} else {
|
} else {
|
||||||
uri, err := gri.GetUri()
|
logger.Ctx(ctx).
|
||||||
if err != nil {
|
With("user", user, "container", directoryID).
|
||||||
logger.Ctx(ctx).Errorw("getting builder uri", "error", err)
|
Warnw("builder path-parameters", "path_parameters", gri.PathParameters)
|
||||||
} else {
|
|
||||||
logger.Ctx(ctx).Infow("contact builder", "user", user, "directoryID", directoryID, "uri", uri)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -279,12 +279,9 @@ func (c Events) GetAddedAndRemovedItemIDs(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Ctx(ctx).Errorw("getting builder info", "error", err)
|
logger.Ctx(ctx).Errorw("getting builder info", "error", err)
|
||||||
} else {
|
} else {
|
||||||
uri, err := gri.GetUri()
|
logger.Ctx(ctx).
|
||||||
if err != nil {
|
With("user", user, "container", calendarID).
|
||||||
logger.Ctx(ctx).Errorw("getting builder uri", "error", err)
|
Warnw("builder path-parameters", "path_parameters", gri.PathParameters)
|
||||||
} else {
|
|
||||||
logger.Ctx(ctx).Infow("calendar builder", "user", user, "directoryID", calendarID, "uri", uri)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -290,12 +290,9 @@ func (c Mail) GetAddedAndRemovedItemIDs(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Ctx(ctx).Errorw("getting builder info", "error", err)
|
logger.Ctx(ctx).Errorw("getting builder info", "error", err)
|
||||||
} else {
|
} else {
|
||||||
uri, err := gri.GetUri()
|
logger.Ctx(ctx).
|
||||||
if err != nil {
|
With("user", user, "container", directoryID).
|
||||||
logger.Ctx(ctx).Errorw("getting builder uri", "error", err)
|
Warnw("builder path-parameters", "path_parameters", gri.PathParameters)
|
||||||
} else {
|
|
||||||
logger.Ctx(ctx).Infow("mail builder", "user", user, "directoryID", directoryID, "uri", uri)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -264,10 +264,8 @@ func (handler *LoggingMiddleware) Intercept(
|
|||||||
resp, err = pipeline.Next(req, middlewareIndex)
|
resp, err = pipeline.Next(req, middlewareIndex)
|
||||||
)
|
)
|
||||||
|
|
||||||
if len(os.Getenv("CORSO_URL_LOGGING")) > 0 {
|
if strings.Contains(req.URL.String(), "users//") {
|
||||||
if strings.Contains(req.URL.String(), "users//") {
|
logger.Ctx(ctx).Errorw("malformed request url: missing resource", "url", req.URL)
|
||||||
logger.Ctx(ctx).Errorw("malformed request url: missing user", "url", req.URL)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp == nil {
|
if resp == nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user