Skip to content
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

Convert HTTP method to uppercase #2712

Closed
wants to merge 68 commits into from

Conversation

lyrixx
Copy link
Contributor

@lyrixx lyrixx commented Apr 7, 2019

Q A
Bug fix? no, but prevent bug in client application
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

pborreli and others added 30 commits February 3, 2019 00:07
…ion-language

Use framework expression language service instead of custom one
GraphQL: Prevent an error when the type factory is null
merging 2.4 into master nothing to see here
Add tests for the SoMany collection

Uses the PropertyAccessor service and don't break the BC

Allow to use multiple fields

Fix cs

Improve cursor-based pagination tests
Enable the pagination via cursor (no page-based pagination)
* Better support for graphql pagination

Add support for graphql before, last, startcursor

* Allow limit 0 for MongoDB

* Fix backwards pagination

* Add hasPreviousPage
…lias

Configure formats provider interface autowiring alias
* Avoid to call serialize in ItemNormalizer

* Allow composite identifiers in getItemIriFromResourceClass
@lyrixx lyrixx force-pushed the ensure-verbe-is-uppercase branch from 182cdab to b219add Compare April 7, 2019 12:58
@soyuka
Copy link
Member

soyuka commented Apr 7, 2019

Could you add a test?

composer.json Outdated Show resolved Hide resolved
@teohhanhui
Copy link
Contributor

Can't we just convert the HTTP method to uppercase, since that's what they should be in anyway?

@lyrixx
Copy link
Contributor Author

lyrixx commented Apr 8, 2019

Can't we just convert the HTTP method to uppercase, since that's what they should be in anyway?

If you think this is a good approach, let's do it. I will update the PR

@lyrixx lyrixx force-pushed the ensure-verbe-is-uppercase branch from 0a21e6b to 28369bb Compare April 8, 2019 16:21
@lyrixx lyrixx changed the title Added a protecting when someone is using a lower case method Convert HTTP method to uppercase Apr 8, 2019
@lyrixx lyrixx force-pushed the ensure-verbe-is-uppercase branch 2 times, most recently from 47b2e43 to 843e491 Compare April 8, 2019 16:24
@lyrixx
Copy link
Contributor Author

lyrixx commented Apr 8, 2019

PR Updated

@@ -123,6 +123,8 @@ private function normalize(bool $collection, ResourceMetadata $resourceMetadata,
$supported ? $operation['method'] = $upperOperationName : $operation['route_name'] = $operationName;
}

$operation['method'] = strtoupper($operation['method']);
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not seem correct to me. $operation['method'] might not be set.

Anyway, this part of the code could probably use some refactoring. $upperOperationName is... weird. 🙈

@lyrixx lyrixx force-pushed the ensure-verbe-is-uppercase branch from 843e491 to 637e4c2 Compare April 8, 2019 16:33
@teohhanhui teohhanhui changed the base branch from master to 2.4 April 15, 2019 17:16
@teohhanhui teohhanhui closed this Apr 15, 2019
@teohhanhui
Copy link
Contributor

I'll merge it in #2734 as @lyrixx does not allow pushing to his branch. 🙈

@lyrixx lyrixx deleted the ensure-verbe-is-uppercase branch April 16, 2019 12:14
@lyrixx
Copy link
Contributor Author

lyrixx commented Apr 16, 2019

I'll merge it in #2734 as @lyrixx does not allow pushing to his branch.

Oups, sorry. This was not intended

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.

None yet