spring-cloud / spring-cloud/spring-cloud-config

Serving plain text file using a default label is not working in Finchley M9

Open
#961 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Java
Stars
2k
Forks
1.3k
Avg merge
2d 59m
Merged PRs (30d)
16

Description

Using a config server at version Finchley.M9 with the following properties

spring:
  application:
    name: testapp
  profiles:
    active: native
  cloud:
    config:
      server:
        default-label: default-label-test

and config directory layout src/main/resources/config/default-label-test/default-label-nginx.conf

When I request the contents of default-label-nginx.conf with a request
curl http://localhost:9999/testapp/native/default-label-nginx.conf\?useDefaultLabel, the mapped controller is https://github.com/spring-cloud/spring-cloud-config/blob/master/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/EnvironmentController.java#L99
but should be
https://github.com/spring-cloud/spring-cloud-config/blob/master/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/resource/ResourceController.java#L81

Using Edgware.SR2 the correct controller method is mapped

@snicoll mentioned that request mapping has changed in Boot 2, see https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide#spring-mvc-path-matching-default-behavior-change

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the request with the Finchley.M9 configuration and inspect the mappings in EnvironmentController.java and ResourceController.java at the referenced lines. Compare the request-mapping behavior with the Boot 2 path-matching migration note. Done means the plain-text file request using useDefaultLabel reaches the resource endpoint and returns the file from the configured default-label directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.