CodingAleCR / http_interceptor

A lightweight, simple plugin that allows you to intercept request and response objects and modify them if desired.
MIT License
134 stars 67 forks source link

Feature Request: Calling response function in reverse order #1

Closed ezzabuzaid closed 4 years ago

ezzabuzaid commented 5 years ago

Hi, it will be good if the interceptors execute the response method from the end back to the start

in the for loop, maybe you can loop over the interceptors from the end

client

CodingAleCR commented 5 years ago

Hey, sure, that's a possibility. Although if you don't mind me asking which would be a case in which you'd need it. When I did that I just thought that it'd be good to have them apply changes in the order that they were added.

ezzabuzaid commented 5 years ago

Hi, Angular does that with the interceptors, and I liked much, the first case is the logging, when I want to log the time needed for the request to finish, and there's a variety of cases may you want

I think it can be an option, reverse or not, and believe me it's useful.

and I was thinking about some useful changes

and I want to thank you for that effort.

CodingAleCR commented 5 years ago

Yeah, that sounds like a good idea, I'll add it as a feature for release 1.0.0 hopefully coming soon.

CodingAleCR commented 4 years ago

As I'm planning to separate into different contracts the request and response interceptors then I won't be adding the reverse order flag for now.