Laravel Test Case custom headers doesn't found in RouteServiceProvider #41760
Unanswered
arsalan-onschedule
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have multiple API versions and each version have a dedicated route file, whenever API is called with a client it provides a specific API version in headers which is being retrieved in RouteServiceProvider. The problem is that when I am performing a test the request doesn't have the custom headers which I am providing with the JSON call.
Below is the test case code.
and this is RouteServiceProvider code
I would like also add there, as there is no Accept-Version find in request headers so it reads the default api.php file. and there is a surpizing output when i write this code here.
In the output when the dump function is called without route it shows different headers and in Route callback, there are different headers
Dump output of outside of route call
Dump output inside the Route callback
Beta Was this translation helpful? Give feedback.
All reactions