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

Add a HEAD route for every GET #1693

Merged
merged 5 commits into from
May 24, 2019
Merged

Add a HEAD route for every GET #1693

merged 5 commits into from
May 24, 2019

Conversation

jameskleeh
Copy link
Contributor

Closes #1489.

If you know of a better way of going about this let me know. I tried to do it in the abstract route builder itself but since only a single route is returned, the caller would have no way of further processing the route.

@@ -94,7 +94,7 @@ public void process(BeanDefinition<?> beanDefinition, ExecutableMethod<?, ?> met
String functionName = beanDefinition.getValue(FunctionBean.class, String.class).orElse(methodName);
String functionMethod = beanDefinition.getValue(FunctionBean.class, "method", String.class).orElse(null);

UriRoute route = null;
List<UriRoute> routes = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Specify size of 2 to the array

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@graemerocher
Copy link
Contributor

Failing tests?

@jameskleeh
Copy link
Contributor Author

Looks to be set ordering funny business:

    json.message == 'Method [POST] not allowed. Allowed methods: [GET, HEAD]'
    |    |       |
    |    |       false
    |    |       6 differences (89% similarity)
    |    |       Method [POST] not allowed. Allowed methods: [(H)E(AD), (G)E(T-)]
    |    |       Method [POST] not allowed. Allowed methods: [(G)E(T-), (H)E(AD)]
    |    Method [POST] not allowed. Allowed methods: [HEAD, GET]

@graemerocher graemerocher merged commit 10d8928 into master May 24, 2019
@jameskleeh jameskleeh deleted the head-route branch March 3, 2020 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically provide HEAD for GET
2 participants