Skip to content
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

generated client changed based uri from 'https' to 'http' when executing SaveChanges() after DeleteObject() #304

Open
whyndsidt opened this issue Jul 21, 2022 · 0 comments

Comments

@whyndsidt
Copy link

Describe the bug

Using an instance of the generated container (public partial class Container : global::Microsoft.OData.Client.DataServiceContext) to delete a an object on the odata service.
I retrieved the object then called DeleteObject().
On SaveChanges() I was getting an error that the api call was HTTP in an HTTPS environment (from a blazor app).
On examination, container creation was handed a URI object created from a base uri that read "https:/...".
When we capture the BuildingRequest event, it is clear that the base uri has changed to "http:/...".
A short term solution was to change RequestUri (part of the event arguments) back to the "https:/..." form.

We were curious if there was a reason the URI was being changed?

Version of the Project affected

MicrosoftOData.Core v7.12.0
Microsoft Visual Studio Professional 2022 (64-bit)
Version 17.0.4

To Reproduce

Steps to reproduce the behavior:

  1. In Blazor App, create odata client by referencing odata service
  2. Create instance of odata container from instance of IODataClientFactory using uri created from https:... path.
  3. Use odata container to retrieve record from service
  4. Use same container to remove record with call to RemoveObject()
  5. Call on SaveChanges()

Call will be executed with http path instead of requested https path.

Expected behavior

We did not expect the call to change the http to an https.

Actual behavior

Call did change address from https to http (we made it work by changing it back in the BuildRequest event.

Screenshots

Not really applicable

Additional context

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant