-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
I am attempting to delete a file and this is failing due to the slash in the file location.
d := map[string]string{
"filelocation": "nsconfig/ssl",
}
err = adc.DeleteResourceWithArgsMap(service.Systemfile.Type(), myfilename, d)This returns a 400,
GET /nitro/v1/config/systemfile/myfilename?args=filelocation:nsconfig/ssl HTTP/1.1" 400 111 "-" "Go-http-client/1.1
As it doesn't find the item it doesn't try to delete.
The fix was to escape the string and ensure / is changed to %2F.
d := map[string]string{
"filelocation": url.PathEscape("nsconfig/ssl"),
}
err = adc.DeleteResourceWithArgsMap(service.Systemfile.Type(), myfilename, d)GET /nitro/v1/config/systemfile/myfilename?args=filelocation:nsconfig%2Fssl HTTP/1.1" 200 221 "-" "Go-http-client/1.1
DELETE /nitro/v1/config/systemfile/myfilename?args=filelocation:nsconfig%2Fssl HTTP/1.1" 200 57 "-" "Go-http-client/1.1"
I'm assuming this will be the same issue for all query parameters and not specific to my use case.
Metadata
Metadata
Assignees
Labels
No labels