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

EigenDA Proxy returns HTTP status code 200 when using a malformat commitment #282

Open
adam-xu-mantle opened this issue Feb 8, 2025 · 0 comments

Comments

@adam-xu-mantle
Copy link

adam-xu-mantle commented Feb 8, 2025

Problem

In the EigenDA Proxy get, for some commitments with incorrect formats, the api still returns a status code of 200. This may mislead the users of the EigenDA Proxy.

  • GET
curl -v http://127.0.0.1:3100/get/0x0100001  
*   Trying 127.0.0.1:3100...
* Connected to 127.0.0.1 (127.0.0.1) port 3100
> GET /get/0x0100001 HTTP/1.1
> Host: 127.0.0.1:3100
> User-Agent: curl/8.4.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Sat, 08 Feb 2025 08:09:53 GMT
< Content-Length: 0
< 
* Connection #0 to host 127.0.0.1 left intact
  • PUT
curl -v http://127.0.0.1:3100/put/0x00001 -d 'v1.6.3 test'
*   Trying 127.0.0.1:3100...
* Connected to 127.0.0.1 (127.0.0.1) port 3100
> POST /put/0x00001 HTTP/1.1
> Host: 127.0.0.1:3100
> User-Agent: curl/8.4.0
> Accept: */*
> Content-Length: 16
> Content-Type: application/x-www-form-urlencoded
> 
< HTTP/1.1 200 OK
< Date: Sat, 08 Feb 2025 09:17:30 GMT
< Content-Length: 0
< 
* Connection #0 to host 127.0.0.1 left intact

Proposed Solution

Using regular expressions to validate the content of routingVarNamePayloadHex.
"{"+routingVarNamePayloadHex+":(?:[0-9a-fA-F]{2})*}"

@adam-xu-mantle adam-xu-mantle changed the title EigenDA Proxy /get returns HTTP status code 200 when using a malformat commitment EigenDA Proxy returns HTTP status code 200 when using a malformat commitment Feb 8, 2025
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

No branches or pull requests

1 participant