tests: Check Content-Type header returned from RPC server #7833

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2016_04_rpc_tests_check_content_type changing 1 files +5 −0
  1. laanwj commented at 1:46 PM on April 7, 2016: member

    Check the Content-Type header that is returned from the RPC server. Only if it is application/json the data is supposed to be parsed as JSON.

    This gives better reporting if the HTTP server happens to return an error that is not JSON-formatted, which is the case if it happens at a lower level before JSON-RPC kicks in.

    Before: Unexpected exception caught during testing: No JSON object could be decoded

    After: JSONRPC error: non-JSON HTTP response with '403 Forbidden' from server @sipa

  2. tests: Check Content-Type header returned from RPC server
    Check the Content-Type header that is returned from the RPC server. Only
    if it is `application/json` the data is supposed to be parsed as JSON.
    
    This gives better reporting if the HTTP server happens to return an error that is
    not JSON-formatted, which is the case if it happens at a lower level
    before JSON-RPC kicks in.
    
    Before: `Unexpected exception caught during testing: No JSON object could be decoded`
    
    After: `JSONRPC error: non-JSON HTTP response with '403 Forbidden' from server`
    5078ca4543
  3. laanwj added the label Tests on Apr 7, 2016
  4. laanwj commented at 6:46 AM on April 15, 2016: member

    @MarcoFalke can you take a look here?

  5. laanwj merged this on Apr 18, 2016
  6. laanwj closed this on Apr 18, 2016

  7. laanwj referenced this in commit b1bf511af6 on Apr 18, 2016
  8. MarcoFalke commented at 7:46 PM on April 18, 2016: member

    utACK 5078ca4

    Sorry for taking so long, do you mind if this ends up upstream?

    https://github.com/jgarzik/python-bitcoinrpc/pull/65

  9. MarcoFalke referenced this in commit d5a9de352c on Jun 9, 2016
  10. nomnombtc referenced this in commit bc2c2cdd80 on Nov 12, 2016
  11. nomnombtc referenced this in commit c528092e35 on Nov 12, 2016
  12. nomnombtc referenced this in commit c580472b41 on Nov 13, 2016
  13. sickpig referenced this in commit 641e9097ed on Nov 14, 2016
  14. MarcoFalke locked this on Sep 8, 2021
Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me