Closed aadupirn closed 6 years ago
@aadupirn thanks for your interest in Ocelot, this makes sense! I will get round to it asap. I would classify it as a bug I think which means I will do it sooner than features! Thanks for your input into the project.
@aadupirn I had a look into this issue and tracking back the changes I can see that in a previous issue we decided not to support http or https in the Consul Address. I've updated the Ocelot docs to show this.
The main problem is what takes priority if a user sets both, this will always be different for different users :/ so it is probably better for Ocelot to just no allow it. Also reading Consul docs doesnt seem to make sense to put scheme into the address field :/
Sorry for not changing the behaviour hopefully this makes sense!
New Feature
When consul returns an address that includes the
http
orhttps
prefix when providing services after a service registry query Ocelot should recognize that theDownstreamScheme
field needs not be applied.Motivation for New Feautre
Ocelot will append the
DownstreamScheme
field in front of an address even if it's not necessary, resulting in downstream paths likehttp://http://localhost:9002/products/1
. This could be avoided with a simple regex expression to remove the scheme provided from the service registry if there is one.This is more of a QoL issue but it did result in me butting my head against a wall for a couple hours trying to figure out why my gateway wasn't getting to my service.