Handling Dependency 4XX in REST [closed] - rest

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am wondering what would be the appropriate error code to bubble upto my clients when I get 4XX from my dependencies. Say for example, one of my downstream services returns to me a 401 code. This means my own server was not authorised for this request. How should I bubble this information to my clients? Would 424 be the appropriate code to bubble up? I read that it was added to HTTP as an extension, so is it recommended to use it?

Status codes from extensions can be used when properly registered and sufficiently defined.
That said, a 4xx seems to be incorrect here. If your server is not configured properly to access a back end, that's a server error, thus a 5xx.

Related

WSO2 BAM: howto send log event via REST endpoint [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want to send log events to BAM 2.4.1 via client REST but I dont find any example about it so I need to know what is the endpoint url and some example about building of the json message to send.
Thanks in advance for any help
Currently, it doesn't have a REST API to publish events. Current options are listed here.
In addition you can use Analytics JavaScript (JS) API as well. It has this limitation.
Currently due to a limitation, client applications should be deployed
in the same domain as the Dashboard server. i.e -
DAS_HOME/repository/deployment/server/webapps

Worklight - Persistency data access issue com.worklight.core.exceptions.PersistentDataAccessException: Persistency data access [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
We have seen some error logs on the worklight messages.logs we are not able to understand or replicate the scenario, Interestingly all the issues recorded are with respected to WKUHB database, Can anyone please share more information how can we understand the impact of this error on Mobile Apps.
Worklight version used :- 6.1.0.2, DB2 Version :- v9.7.0.7
The error log states:
A communication error occurred during operations on the connection's underl ying socket, socket input stream, or socket output stream. ... A remote host did not respond within the timeout period.
You need to check in your network setup why the timeout was reached.
You may also look in your underlying application server for the management of stale connections.

How to implement or use a WebSocket in perl? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to have 3 major things from perl and don't know how to go about it.
Non Blocking websocket implementation like mojo.
The server needs to accept broadcast calls after it has started
The server needs to be able to access data that is on a different thread.
I have tried mojo but didn't find a way to control the port (I can live with that) and didn't figure out how to call events after the server has started. I wasn't able to test if it could handle events after the fact.
I have tried Net::WebSocket::Server but it is blocking. I am tempted to wrap my own code around it so that it can handle non blocking and shared data as it is by far the simplest implementation and easy to modify.
I have also tried pocket.io but it didn't have a very easy way to implement OO design and still remain thread safe. (Mostly because of the Plack framework).
Does anyone have a good example of how to do this with Mojolicious or pocket.io? If not I will just have to implement my own implementation.

Akka message throttling [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am trying to implement following scenario with Akka but hitting heap limitations (out of memory errors):
User uploads a text file(25mb aprox) containing around 1000000 lines.
After file gets uploaded HTTP 200 OK is sent back to the client and file processing is starting in the background.
Each line should be processed (saved to the database and external web service call should be made to look up the contents of the line with database update if lookup returned some results.)
Please suggest the approach/pattern.
Many thanks in advance!
There are several ways for achieve this, for example:
1) Use bounded mailbox for some of your actors, then your code that send messages to such actors will block if the target mailbox is full;
2) Use work pulling model when some of your actors will "ask" for more work when idle.

HTTP response splitting attack prevention in perl [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
How to prevent HTTP response splitting attack?
HTTP Response splitting allows an attacker to manipulate the response received by a web browser. is there any way to prevent this kind of attack from perl.
As usual. Do not trust any data received from user.
If you need to include some data from user to the headers use uri_escape() or other appropriate mechanism which will escape unsafe data.
Don't put unsanitized data into headers (e.g. redirects or cookies).