Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] DTL response null result with 404 http status DEMO code #1389

Closed
wants to merge 3 commits into from

Conversation

shidaxi
Copy link
Collaborator

@shidaxi shidaxi commented Dec 22, 2023

Goals of PR

Core changes:

  • handler support return http status code
  • return 404 http status code when result is null

Related Issues:

  • with this we can enable cache safely

@shidaxi
Copy link
Collaborator Author

shidaxi commented Dec 22, 2023

Test

 curl "localhost:7878/transaction/index/87?backend=l2" -i

HTTP/1.1 404 Not Found
X-Powered-By: Express
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Content-Length: 33
ETag: W/"21-CMqNFJ1GmGJsYiAIPHNf2iBKJ9E"
Date: Fri, 22 Dec 2023 12:51:18 GMT
Connection: keep-alive
Keep-Alive: timeout=5

{"transaction":null,"batch":null}

                                                                                                                                    
➜  curl "localhost:7878/transaction/index/86?backend=l2" -i

HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Content-Length: 1054
ETag: W/"41e-LAO9Ef7iD5peiLs9WMbN9FjpsHw"
Date: Fri, 22 Dec 2023 12:51:24 GMT
Connection: keep-alive
Keep-Alive: timeout=5

{"transaction":{"index":86,"value":"0x0","batchIndex":null,"blockNumber":16005,"timestamp":1703089712,"queueOrigin":"sequencer","confirmed":false,"gasLimit":"0","target":"0x0000000000000000000000000000000000000000","origin":null,"data":"0xf8a8808402faf08082864294deaddeaddeaddeaddeaddeaddeaddeaddead111180b844a9059cbb00000000000000000000000000000500e87ee83a1bfa233512af25a4003836c800000000000000000000000000000000000000000000000000005af3107a400045a045f220e8638eb5f5cdb2259efbdd36533597eae1776d9fdc81d2914d59f60203a03e5202f7743b809bebbe8b8a181ae4f55a472f6b9b5de1ff695c29a102c0037e","decoded":{"sig":{"v":0,"r":"0x45f220e8638eb5f5cdb2259efbdd36533597eae1776d9fdc81d2914d59f60203","s":"0x3e5202f7743b809bebbe8b8a181ae4f55a472f6b9b5de1ff695c29a102c0037e"},"value":"0x0","gasLimit":"34370","gasPrice":"50000000","nonce":"0","target":"0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111","data":"0xa9059cbb00000000000000000000000000000500e87ee83a1bfa233512af25a4003836c800000000000000000000000000000000000000000000000000005af3107a4000"},"queueIndex":null},"batch":null}

@shidaxi shidaxi changed the title DTL response null result with 404 http status DEMO code [WIP] DTL response null result with 404 http status DEMO code Dec 22, 2023
guoshijiang
guoshijiang previously approved these changes Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants