I was trying to implement SimpleUpdate in our terraform provider and, when uploading FW packages to the FW inventory, I found out that the API was returning a 500 error with no error description (favorite developer kind of issue 😆 ). It was driving me crazy but after a while I saw the following (please check line 387):
Hey Sean,
I was trying to implement SimpleUpdate in our terraform provider and, when uploading FW packages to the FW inventory, I found out that the API was returning a 500 error with no error description (favorite developer kind of issue 😆 ). It was driving me crazy but after a while I saw the following (please check line 387):
https://github.com/stmcginnis/gofish/blob/f20250aa04e04c84b6dfec05391eb1d542675e29/client.go#L385-L389
As per current implementation, on CreateFormFile method, we use as filename the file.Name() method, which actually returns the whole path of the file.
To solve this, we need to just grab the filename from the path, using for instance filepath.Base() method. Something like this
I will send a PR that implements that, just wanted to open this issue for reference, just in case anyone else faces the same in the future.
Thanks! /Miguel