Closed rngtng closed 2 years ago
Btw. I fixed this with the workaround of moving the before request hook into a plugin. still I'd expect behaviour of httpbook, same as text version...
the reason is that I parse the whole file from disk and the executing cell from the content of the cell and just patch those together.
However, this causes my global script logic to not work correctly. When parsing, the global script is attached directly to the HttpRegion and not thie httpFile. The events request
, response
, streaming
and responseLogging
can be easily changed. The Event after
gives me problems.
The bug was fixed with the new version of vscode-httpyac. Updating httpbook is not necessary
nice!
I don't really like the two newly created hooks (BeforeHttpRegion and AfterHttpRegion) in the plugin API. Please don't consider these two hooks as part of the api, That is why I have not yet included them in the documentation. I will probably remove them again by extending my hook system. And cool that it works now.
I have removed the two hooks BeforeHttpRegion
and AfterHttpRegion
and replaced them with an ExecuteHook
+ merge Functionality of hooks. In detail, a different order now occurs between interceptor/ hook calls between HttpFile and HttpRegion hooks. However, these should not be a major problem.
Before: httpRegion - hooks => httpRegion - afterLoop => httpFile hooks => httpFile - afterLoop Now: httpRegion - hooks => httpFile hooks => httpRegion - afterLoop => httpFile - afterLoop
Imagine following code:
Running this in std. vs-plugin or cli works fine for both requests, but in httpbook it doesn't. Looks like the global hooks are not evaluated