Giter Site home page Giter Site logo

kitura-cors's Introduction

Kitura

A Swift Web Framework and HTTP Server

Docs Build Status - Master macOS Linux Apache 2 codecov codebeat badge Slack Status

Summary

Kitura is a web framework and web server that is created for web services written in Swift. For more information, visit www.kitura.dev.

Table of Contents

Features

  • URL routing (e.g., GET, POST, PUT, DELETE, PATCH)
  • Codable routing
  • URL parameters
  • Static file serving
  • FastCGI support
  • SSL/TLS support
  • Pluggable middleware

Getting Started

Visit https://www.kitura.dev for a Getting Started guide, tutorials, and API reference documentation.

Contributing to Kitura

All improvements to Kitura are very welcome! Here's how to get started with developing Kitura itself.

  1. Clone this repository.

$ git clone https://github.com/Kitura/Kitura

  1. Build and run tests.

$ swift test

You can find more info on contributing to Kitura in our contributing guidelines.

Notes

  • Swift-NIO is now the default network engine via the Kitura-NIO package. If for some reason you require the old Kitura-net package, you can still enable it by setting an environment variable KITURA_NIO=0 during build.
  • Most Kitura packages have been updated to require at least Swift 5.2 in order to maintain backward compatibility.

Community

We love to talk server-side Swift, and Kitura. Join our Slack to meet the team!

kitura-cors's People

Contributors

bdhernand avatar dannys42 avatar dfirsht avatar djones6 avatar helenmasters avatar ianpartridge avatar irar2 avatar kyemaloy97 avatar makleso6 avatar mbarnach avatar na-gupta avatar quanvo87 avatar rolivieri avatar sdrpa avatar seabaylea avatar shihabmehboob avatar shmuelk avatar swiftdevops avatar vadimeisenbergibm avatar youming-lin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kitura-cors's Issues

CORS 2.0.0 breaks Kitura 2.1.0

Hi,
Kitura-CORS seems to be incompatible with the curent Kitura-Release 2.1.x
Adding CORS to the dependencies breaks the SPM, causing it to run in an infinite fetch-loop. See the following example Package.swift

// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "CORS-Bug",
    dependencies: [
        .package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from:"2.1.0")),
        .package(url: "https://github.com/IBM-Swift/Kitura-CORS.git", .upToNextMinor(from:"2.0.0"))
    ],
    targets: [
        .target(name: "CORS-Bug",dependencies: []),
    ]
)

Tested with the current swift-toolchain as well as the toolchains delivered with Xcode 9.1 and 9.2

New Tag

Just a heads up - this repo needs a new tag to work with Kitura 0.26.

Document properly type alias

The AllowedOriginsRegExType in AllowedOrigins.swift is not documented.
The general comment should be specified and move next to the typealias to avoid a warning when generating the documentation.

Allowed Origin

Hi! Thanks for great framework!
Is it possible to add new case in enum AllowedOrigins?
That would be wonderful to add case sameAsOrigin with logic in CORS

private func setAllowOriginHeader(request: RouterRequest, response: RouterResponse) {

        let requestOrigin = request.headers["Origin"]!
        var headerValue : String
        
        switch options.allowedOrigin {
        case .all:
            headerValue = "*"
        case . sameAsOrigin: /// Here
            headerValue = requestOrigin
        case .set, .origin, .regex:
            if isAllowed(origin: requestOrigin) {
                headerValue = requestOrigin
            }
            else {
                headerValue = "false"
            }
        }
        response.headers.append("Access-Control-Allow-Origin", value: headerValue)
    }

Please specify the version of package...

I wasted my time about half a day cause of Swift Package Manager dependencies...
No one let me know the latest version of 'Kitura-CORS' package in this github page. So i tried lots of times to build but fails every time. Wrong package version and dependency...
Please tell us the latest version of this package in the github README... to prevent wasting time...

Swift 4.0

Any chance we can update Package.swift for Swift 4? Most of the other Kitura packages have already been updated.

Tag 0.33

This repo need to be tagged 0.33 to work with Kitura 0.33. Also update the dependency in Package.swift.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.