lord-kyron / terraform-provider-phpipam

Terrform provider for PHPIPAM
https://registry.terraform.io/providers/lord-kyron/phpipam/latest
Apache License 2.0
54 stars 30 forks source link

Empty body is sent when making request #67

Closed MatthieuuC closed 1 year ago

MatthieuuC commented 1 year ago

Hello :wave:

I noticed that the provider makes GET/POST calls with an empty body {}.

This is a problem for example if our phpipam is behind a load balancer that refuses GET requests with a body (Google Load balancer for example ...).

Terraform DEBUG Output

phpipam_subnet.subnet_prod: Refreshing state... [id=7]
2023-05-11T17:34:55.806+0200 [INFO]  provider.terraform-provider-phpipam_v1.3.8: 2023/05/11 17:34:55 Request Body Debug ................... {}: timestamp=2023-05-11T17:34:55.806+0200
2023-05-11T17:34:55.806+0200 [INFO]  provider.terraform-provider-phpipam_v1.3.8: 2023/05/11 17:34:55 Request URL Debug ...................Method: GET, UR: https://127.0.0.1/api/terraform/subnets/7/: timestamp=2023-05-11T17:34:55.806+0200
2023-05-11T17:34:55.806+0200 [INFO]  provider.terraform-provider-phpipam_v1.3.8: 2023/05/11 17:34:55 Request Body Debug ................... {}: timestamp=2023-05-11T17:34:55.806+0200

We can see the empty body after ...................

So in my case I can you the provider because my PHPIPam server is behind GCP GLB.

Thanks

lord-kyron commented 1 year ago

@pavel-z1 I've never thought about this usecase. Is there something we can do about it?

MatthieuuC commented 1 year ago

@pavel-z1 Just for the example (I'm not a dev), https://github.com/MatthieuuC/phpipam-sdk-go/commit/2742655a826a3d72a445a1ac765ce69bd4359149

Maybe this will fix ?

pavel-z1 commented 1 year ago

Hi @MatthieuuC It makes sense Can you please make a pull request to the SDK?

lord-kyron commented 1 year ago

@pavel-z1 After the pull request to the sdk is merged, can you add this feature to your current pull request so that I can merge everything at once?

pavel-z1 commented 1 year ago

Yes I will do it

UpperM commented 1 year ago

Thanks guys, I've made a PR https://github.com/pavel-z1/phpipam-sdk-go/pull/14

I've not tested (I don't no how to do), I think It can do the job

(Yes I'm @MatthieuuC, it's my personnal account)

lord-kyron commented 1 year ago

Fixed with https://github.com/lord-kyron/terraform-provider-phpipam/pull/68 New version will be released tomorrow.

lord-kyron commented 1 year ago

New version was released today - v1.5.0 including all the changes.