Commit efe7ae5
authored
Fixing bug on stuck content-type header
When I use FeatureTestTrait if I use withBodyFormat('json') function on one request all subsequent requests are sent with content-type: application/json even if their body format is not 'json'.
This bug started when I upgraded CI from 4.0.x to 4.2.11. After long investigation I think I found the source of the problem. On line 289 initialization of request has been changed to Services::request($config, true) so for each subsequent test request same instance is used. That's why if content-type on one request is set then all other requests are sent with this header. We need some reset mechanism. I dont know if this method is right but it worked for me.1 parent ed25a2c commit efe7ae5
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | | - | |
| 367 | + | |
| 368 | + | |
368 | 369 | | |
369 | 370 | | |
370 | 371 | | |
| |||
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
384 | | - | |
| 385 | + | |
385 | 386 | | |
386 | 387 | | |
387 | 388 | | |
0 commit comments