Skip to content

Swagger-ui redirect fails when on IPv6 locally #1623

@virkt25

Description

@virkt25

Description / Steps to reproduce / Feature proposal

Create an app using lb4 app. Have your OS configured for IPv6 (default on Macs). Go to http://[::1]:3000/swagger-ui

Instead of loading the swagger-ui modules to explore the API's an error is generated saying Failed to load API Definition.

image

I suspect this has something to do with the RegEx used below. I played around with the RegEx used in regex101.com and I think the correct regex should be /:[0-9]+(?!])/ to work with IPv6 addresses.

I made the changes but can't verify locally but for some reason I can't verify the fix ... creating this issue to track it as I plan to go back to trying to debug my dev environment. I can't even get a console.log statement added to the function to print :/

https://github.com/strongloop/loopback-next/blob/master/packages/rest/src/rest.server.ts#L358-L371

Acceptance Criteria

  • Able to redirect to /swagger-ui when on IPv6 without an error

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions