| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Just need a little more context for what the change is doing and how other paths are affected.
Sorry, something went wrong.
| path = path_segment | ||
| else: | ||
| if not self.path.endswith('/') and path_segment != "": | ||
| self.path = self.path if path_segment.startswith('/') else self.path + '/' |
There was a problem hiding this comment.
Can you explain the fix? I'm not quite sure just by looking at this line why the path starting with / here if path_segment.startswith('/') would have an affect on whether an ending / would be needed and this line seems to be adding a / slash whereas line 727 was seemingly doing the same before? In general it's nice to get some sort of writeup (a few sentences) in the PR summary as to what was broken before and how the behavior changed. For this case you could give an example of how the old path was formed and what the new HEC path is now and how other paths are affected after this change.
Sorry, something went wrong.
There was a problem hiding this comment.
Previously / was added always for all the paths irrespective of the path_segment, hence the resulting path was always path = path + / which failed for the HEC as /services/collector/event/ results in 404,
Now / will be added only when path_segment is present so that the resulting path = path + / + path_segment and if there is no path_segment then the resulting path = path
Now the / is added conditionally and hence removed from line 727
I will add some comments and also add a test case for the HEC and update the PR
Sorry, something went wrong.
removed commented code
| Back | FazBrowse Home | New Git URL |
Fix for the Issue #345
Previously path was always updated to path + /
This implementation fails while using the endpoint /services/collector/event as /services/collector/event/ results in 404
The fix removes the hard coded addition of the / to all the paths, and it makes it conditional based on the presence of the path_segment for the get/post actions. If path_segment' exists the pathwill be updated topath + / `