Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

Malformed response when trying to validate address #4

Open
shachibista opened this issue Aug 12, 2018 · 0 comments
Open

Malformed response when trying to validate address #4

shachibista opened this issue Aug 12, 2018 · 0 comments

Comments

@shachibista
Copy link

When trying to validate an address:

curl -v "https://papapi.se/json/?token=<TOKEN>&v=sdf|sdf|sdf|sdf" (address is clearly invalid)

The response is:

< HTTP/1.1 200 OK
< Date: Fri, 10 Aug 2018 16:52:06 GMT
< Server: Apache
< X-Powered-By: PHP/5.5.38
< Access-Control-Allow-Origin: *
< Pragma: public
< Cache-control: private
< Expires: -1
< Upgrade: h2,h2c
< Connection: Upgrade
< Transfer-Encoding: chunked
< Content-Type: application/json; charset=utf-8
< 
<br />
<b>Warning</b>:  mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in <b>/[redacted]/index.php</b> on line <b>743</b><br />
<br />
<b>Warning</b>:  mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in <b>/[redacted]/index.php</b> on line <b>753</b><br />
<br />
<b>Warning</b>:  mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in <b>/[redacted]/index.php</b> on line <b>763</b><br />
* Connection #0 to host papapi.se left intact
{"api":{"name":"PAP-API","url":"HTTPS://WWW.PAPAPI.SE/","version":"1.22","encoding":"UTF-8"},"result":{"address":{"street":"SDF","number":"sdf","zipcode":"sdf","city":"SDF"},"status":{"code":"100","description_sv":"KORREKT ANGIVEN ADRESS","description_en":"CORRECT SPECIFIED ADDRESS"}}}

Note two issues:

  1. The JSON response is tainted by PHP warning
  2. The response says the address is "CORRECT SPECIFIED ADDRESS" even though it is clearly incorrect.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant