Add support for requestInterceptor / responseInterceptor.
- Display mutated requests from request interceptor in curl output in UI. Put this behind showMutatedRequest flag so that the mutation can be silent. - Document requestInterceptor, responseInterceptor and showMutatedRequest in README.md - Add tests
This commit is contained in:
@@ -237,6 +237,11 @@ export const requests = createSelector(
|
||||
state => state.get( "requests", Map() )
|
||||
)
|
||||
|
||||
export const mutatedRequests = createSelector(
|
||||
state,
|
||||
state => state.get( "mutatedRequests", Map() )
|
||||
)
|
||||
|
||||
export const responseFor = (state, path, method) => {
|
||||
return responses(state).getIn([path, method], null)
|
||||
}
|
||||
@@ -245,6 +250,10 @@ export const requestFor = (state, path, method) => {
|
||||
return requests(state).getIn([path, method], null)
|
||||
}
|
||||
|
||||
export const mutatedRequestFor = (state, path, method) => {
|
||||
return mutatedRequests(state).getIn([path, method], null)
|
||||
}
|
||||
|
||||
export const allowTryItOutFor = () => {
|
||||
// This is just a hook for now.
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user