Skip to content
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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

xn3cr0nx
Copy link

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

  • Enhancement (a non-breaking change which adds functionality)

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:

[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]com.iota.iri.service.APIIntegrationTests.com.iota.iri.service.APIIntegrationTests
[ERROR] Run 1: APIIntegrationTests.setUp:91 » SpentAddresses There is a problem with accessin...
[ERROR] Run 2: APIIntegrationTests.tearDown:118 Exception occurred shutting down IOTA node
[INFO]
[INFO]
[ERROR] Tests run: 233, Failures: 0, Errors: 1, Skipped: 1

I'm not really sure this is due to changes.

Checklist:

  • My code follows the style guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Patrick Jusic added 2 commits March 20, 2019 11:36
@iotaledger iotaledger deleted a comment Mar 20, 2019
@iotaledger iotaledger deleted a comment Mar 20, 2019
@iotaledger iotaledger deleted a comment Mar 20, 2019
@iotaledger iotaledger deleted a comment Mar 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant