-
Notifications
You must be signed in to change notification settings - Fork 12
fix: cloud sdk #451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: cloud sdk #451
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -25,26 +25,22 @@ module.exports = () => { | |||||
|
|
||||||
| const cloudSDK = require('@sap-cloud-sdk/http-client') | ||||||
| const { executeHttpRequest: _execute, executeHttpRequestWithOrigin: _executeWithOrigin } = cloudSDK | ||||||
| cloudSDK.executeHttpRequest = wrap(_execute, { | ||||||
| const _executeHttpRequest = wrap(_execute, { | ||||||
| wrapper: function executeHttpRequest(destination, requestConfig) { | ||||||
| return trace( | ||||||
| _cloudSdkSpanName(destination, requestConfig), | ||||||
| _execute, | ||||||
| this, | ||||||
| arguments, | ||||||
| { kind: SpanKind.CLIENT, outbound: destination.name } | ||||||
| ) | ||||||
| return trace(_cloudSdkSpanName(destination, requestConfig), _execute, this, arguments, { | ||||||
| kind: SpanKind.CLIENT, | ||||||
| outbound: destination.name | ||||||
| }) | ||||||
| } | ||||||
| }) | ||||||
| cloudSDK.executeHttpRequestWithOrigin = wrap(_executeWithOrigin, { | ||||||
| Object.defineProperty(cloudSDK, 'executeHttpRequest', { value: _executeHttpRequest }) | ||||||
| const _executeHttpRequestWithOrigin = wrap(_executeWithOrigin, { | ||||||
| wrapper: function executeHttpRequestWithOrigin(destination, requestConfig) { | ||||||
| return trace( | ||||||
| _cloudSdkSpanName(destination, requestConfig), | ||||||
| _executeWithOrigin, | ||||||
| this, | ||||||
| arguments, | ||||||
| { kind: SpanKind.CLIENT, outbound: destination.name } | ||||||
| ) | ||||||
| return trace(_cloudSdkSpanName(destination, requestConfig), _executeWithOrigin, this, arguments, { | ||||||
| kind: SpanKind.CLIENT, | ||||||
| outbound: destination.name | ||||||
| }) | ||||||
| } | ||||||
| }) | ||||||
| Object.defineProperty(cloudSDK, 'executeHttpRequestWithOrigin', { value: _executeHttpRequestWithOrigin }) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Same issue —
Suggested change
Double-check suggestion before committing. Edit this comment for amendments. Please provide feedback on the review comment by checking the appropriate box:
|
||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug:
Object.definePropertywithoutwritable: trueorconfigurable: truedefaults both tofalse, making the property non-writable and non-configurable. This is a stricter result than the original simple assignment, and will silently fail (or throw in strict mode) if any downstream code tries to reassign or redefine the property (e.g. in tests or repeated patching).Double-check suggestion before committing. Edit this comment for amendments.
Please provide feedback on the review comment by checking the appropriate box: