Coder Social home page Coder Social logo

Comments (3)

uglyog avatar uglyog commented on May 30, 2024 1

@bethesque @mefellows we need to update the spec here, and make it consistent. I've looked at the JVM header matching code, and I don't think it is correct:

  1. Compare header keys case insensitive
  2. Compare header contents base on:
    2.1 For cookie, split the value by semi-colon into a whitespace trimmed list, and the header matches if all the actual values contain the expected value at the same position
    2.2 For content-type, split the value by semi-colon and trim white-space, then compare the first value:
    * if the first values differ, it is a mismatch
    * if the first values are the equal, and the tails are both empty, it is a match
    * otherwise, split the tails by = (stripping white-space) into a key-value map and compare case sensitive
    2.3 otherwise strip any white-space after the commas in the values and compare case sensitive.

This looks wrong, but it has worked to date because 99% of header values don't have multiple values and don't use parameters.

from pact-specification.

uglyog avatar uglyog commented on May 30, 2024

In general, we should refer to the HTTP spec to define the rules. The pact spec is clearly wrong.

from pact-specification.

bethesque avatar bethesque commented on May 30, 2024

No worries, what should we change it to?

from pact-specification.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.