Skip to content

Update PSR-7-http-message.md #1194

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

Merged
merged 1 commit into from
Oct 14, 2019
Merged

Update PSR-7-http-message.md #1194

merged 1 commit into from
Oct 14, 2019

Conversation

WinterSilence
Copy link
Contributor

concatenated with a comma

not comma with whitespace

> concatenated with a comma

not comma with whitespace
Copy link
Member

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this

@WinterSilence
Copy link
Contributor Author

@Jean85 pls, check other documents - i see this problem in other place but can’t remember where.
this one little whitespace creates for me big problem - many popular PSR-compatible libraries copy this mistake and dont want fix because "nooby, see PSR" :( pls, adds tests to future PSR.

@Jean85
Copy link
Member

Jean85 commented Oct 14, 2019

You're welcome to write the tests yourself, PSRs are OSS; we already have an util repo (https://github.com/php-fig/http-message-util) so you can write PRs there.

@WinterSilence
Copy link
Contributor Author

@Jean85

You're welcome to write the tests yourself

It's the reason why I consider PSR to be evil. Your team created these recommendations and made them so popular that they essentially became PHP standards. And now I MUST understand not only PSRs, but also whether they are correctly implemented in third-party libraries.

@Jean85
Copy link
Member

Jean85 commented Oct 14, 2019

We recognize that not having a test suite to check for compliance was a failure on our part; but we're still a group of volunteers, like in all OSS software, and we're spending our free time on this.

That's why I'm inviting you (as anyone else that's using and leveraging such standards) to contribute and help the ecosystem.

WinterSilence added a commit to WinterSilence/http-message that referenced this pull request Oct 14, 2019
@WinterSilence
Copy link
Contributor Author

@Jean85 before undertaking feats, make sure that you are in a fairy tale (c) https://github.com/php-http/psr7-integration-tests

@weierophinney
Copy link
Contributor

@WinterSilence The PSR-7 integration tests in php-http have been reviewed by multiple people who worked on the specification, including myself, and they cover the specification well. Most PSR-7 implementations now test against them.

If you feel there's a problem with the tests, raise an issue against that repository.

Finally, comments like the following:

It's the reason why I consider PSR to be evil. Your team created these recommendations and made them so popular that they essentially became PHP standards.

and this:

make sure that you are in a fairy tale (c)

are not only unnecessary, but they are not constructive, and antagonizing. Take your frustrations out elsewhere, please, before posting.

@Zegnat
Copy link

Zegnat commented Nov 13, 2019

this one little whitespace creates for me big problem - many popular PSR-compatible libraries copy this mistake and dont want fix because "nooby, see PSR" :( pls, adds tests to future PSR.

If many popular libraries indeed use , as a separator, wouldn’t it be better to change the PSR-7 copy to read:

Use the getHeaderLine() method to retrieve a header value as a string containing all header values of a case-insensitive header by name concatenated with a comma and space pair (, ).

This way libraries would not have to be rewritten and issue new releases, and it is still just a very small text clarification change to the PSR. (Instead of changing the code example, it changes the text to match the example.)

By my checking in Nyholm/psr7#137 (comment) the RFC specifications fully supports adding an extra space character, so there is no breaking of HTTP here.

@adriansuter
Copy link

Currently there are libraries for both cases.

Without white-space:

With white-space:

So, I guess the PSR7 specification should mention that optional whitespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants