Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.
This repository was archived by the owner on Apr 20, 2021. It is now read-only.

Header-value is parsed as integer and overflows #236

Description

@kalehmann

My environment:

os: debian 9 x86_64
linux: 4.9.0-5-amd64
php-version: 7.0.27-0+deb9u1
behatch/contexts: dev-master (version: 32dcd9b)

Steps to reproduce

Add a simple feature using the Behatch\Context\RestContext:

Feature: Having a header with a numeric value
  Scenario: Having a header with a numeric value
    Given I add "xxx" header equal to "100000000000000000000"
    When I send a GET request to "http://192.168.178.161"

Expected behavior

Behatch sends a request with a header named "xxx" with the value "100000000000000000000"

Actual behavior (checked with wireshark)

Behatch sends a request with the following header:
xxx: 9223372036854775807

Notes

The value behatch actually sends is 9,223,372,036,854,775,807, which is the maximum integer value for 64-bit php (see ). The problem seems to be, that a string containing numbers gets casted to an integer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions