This repository has been archived by the owner on Aug 23, 2020. It is now read-only.
Allow IXI to manage more than POST HTTP requests #1385
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The previous PR was born to allow IXI Modules to decide the content-type they wish to send to the client. The idea is that clients might want to, for example, load web content directly on their browser, get data in XML format, images, or whatever the IXI module serves.
My interest in this topic started from the same goal, precisely to be able to serve web content directly from the node. This functionality is currently not available due to missing handling or HTTP requests different than POST.
Previous PR #743
Previous PR was created for issue #615
Type of change
The previous PR provided changes to enable the node to make HTTP requests different from POST to be managed as fallback by IXI modules.
The changes didn't modify previous POST handling, that's why I would classify the change as enhancement.
I created this new PR because the previous one was developed on iri version 1.4.1.
To improve the previous work I implemented a different handling of X-IOTA-API-Version check management, that is now executed during body parsing, instead of repeating the check in each branch of the switch case (in process function).
I added comments to new functions.
I would like to reopen the discussion about this feature that could be a good enhancement to the iri functionalities.
How Has This Been Tested?
First of all I tried old ixi modules to check if updates are backcompatible (as #743 (comment) asked), even if most of them are deprecated. Moreover I used an easy IXI module to check if the html content was correctly provided.
I launched unit tests and there is a problem I would like to discuss about. The result state:
I'm not really sure this is due to changes.
Checklist: