Mastercard / terraform-provider-restapi

A terraform provider to manage objects in a RESTful API
Other
785 stars 215 forks source link

Double slash "/" added to path when path empty or set to "{id}" #225

Open mwalczykpl opened 1 year ago

mwalczykpl commented 1 year ago

Hi,

rest api I am using do not use any additional path - just hostname. I tried to set path variable to "" or "{id}". However after correct creating object with POST, updates executes query with two "//" like https://example.com//

example:

resource "restapi_object" "identity" {
  path         = "{id}"
  id_attribute = "identity"
  data         = jsonencode(
    {
      "identity" : "xxxxxxxxxx"
    }
  )
}

As a result my application return error like

org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL contained a potentially malicious String \"//\"
DRuggeri commented 11 months ago

Thanks for the report. I think the best recommendation would be to try setting the path to "/"... though I'm not sure how the provider should be expected to issue a GET (on "/"?) to refresh state.