mirror of
https://github.com/americanexpress/baton.git
synced 2025-11-27 15:54:11 +00:00
Removing restriction on methods
This commit is contained in:
parent
f51c862af3
commit
778d6dc328
15
baton.go
15
baton.go
@ -112,17 +112,12 @@ func (baton *Baton) run() {
|
|||||||
client = &fasthttp.Client{TLSConfig: tlsConfig}
|
client = &fasthttp.Client{TLSConfig: tlsConfig}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch baton.configuration.method {
|
if baton.configuration.dataFilePath != "" {
|
||||||
case "GET", "POST", "PUT", "DELETE":
|
data, err := ioutil.ReadFile(baton.configuration.dataFilePath)
|
||||||
if baton.configuration.dataFilePath != "" {
|
if err != nil {
|
||||||
data, err := ioutil.ReadFile(baton.configuration.dataFilePath)
|
log.Fatal(err.Error())
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err.Error())
|
|
||||||
}
|
|
||||||
baton.configuration.body = string(data)
|
|
||||||
}
|
}
|
||||||
default:
|
baton.configuration.body = string(data)
|
||||||
log.Fatal("Invalid method specified")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if preloadedRequestsMode {
|
if preloadedRequestsMode {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user